I am trying to find the best way to pass a parameter to a report in my web app. Here is what I have done so far:
I have built a seperate class that holds my reports called "MyTelerikLib".
I built a report called "DepartmentReport.vb"
I added a SqlDataAdapter to the report called "SqlDataAdapter1"
I configured the adapter to use an existing stored procedure that has a parameter called "@DepartmentID"
If I hard code the SqlDataAdapter parameter value it works fine in preview mode
I have a webform in my main project with a ReportViewer on it and I assigned "DepartmentReport.vb" as it's report.
I would like to be able to dynamically add the value to SqlDataAdapter1 during the reports OnLoad event.
I really want to get the parameter from a session variable but Hard Coded it to 7 here to test it.
Here is what I have been trying on the reports webform Page_Load event:
I have built a seperate class that holds my reports called "MyTelerikLib".
I built a report called "DepartmentReport.vb"
I added a SqlDataAdapter to the report called "SqlDataAdapter1"
I configured the adapter to use an existing stored procedure that has a parameter called "@DepartmentID"
If I hard code the SqlDataAdapter parameter value it works fine in preview mode
I have a webform in my main project with a ReportViewer on it and I assigned "DepartmentReport.vb" as it's report.
I would like to be able to dynamically add the value to SqlDataAdapter1 during the reports OnLoad event.
I really want to get the parameter from a session variable but Hard Coded it to 7 here to test it.
Here is what I have been trying on the reports webform Page_Load event:
Protected |
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
Dim rv As Telerik.Reporting.Report = New DepartmentReport() |
rv.ReportParameters("DepartmentID").Value = 7 |
Me.ReportViewer1.Report = rv |
End Sub |