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
Printable View
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
It coul be done using parameters fields or formula fields in the rpt and 'filling' them in the vb app
JG
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