|
-
Aug 7th, 2010, 09:00 AM
#1
Thread Starter
Lively Member
VB.net how to pass variables to report viewer?
How to pass variables to report viewer?
Dim name As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
name = "John"
Form2.Show() 'form2 contain the report viewer control
End Sub
-
Aug 7th, 2010, 05:23 PM
#2
Re: VB.net how to pass variables to report viewer?
It coul be done using parameters fields or formula fields in the rpt and 'filling' them in the vb app
JG
-
Aug 11th, 2010, 06:46 AM
#3
Member
Re: VB.net how to pass variables to report viewer?
 Originally Posted by nApzTEr
How to pass variables to report viewer?
Dim name As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
name = "John"
Form2.Show() 'form2 contain the report viewer control
End Sub
I am not .Net expert, but i am giving you a sample from what i have done with reporting. if found wrong kindly let me know :O)
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Form2.DataTableAdapter.Fill(Form2.Datatable, 'John')
Form2.ReportViewer1.LocalReport.RefreshReport()
Catch ex As Exception
.... ' Goes ur message box
End Try
'Form2.Show() 'form2 contain the report viewer control
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|