August 9, 2007 at 2:53 pm
Hi,
I've developed two local reports in Visual Web Developer Express using the reporting addin.
I now want to execute the reports after a user selects from a dropdownlist.
The reports are being displayed in a report viewer control.
Both reports load just fine the first time after the first select from the dropdownlist. However, when I select the second report from the list, the reportviewer control does not refresh with the selected report. In other words, both reports display when either is selected from the dropdownlist. However, selecting a different report from the dropdownlist does not load the report (the first selected report is displayed again.)
Below is my code. Can anyone help!?
Thanks
Protected Sub ddReportName_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddReportName.SelectedIndexChanged
Select Case Me.ddReportName.SelectedValue
Case "PHS"
Me.ReportViewer1.LocalReport.ReportPath = ProjectHours.rdlc"
Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1_v_CSRptProjectHours", ObjectDataSource1))
Me.ReportViewer1.LocalReport.Refresh()
Case "CP"
Me.ReportViewer1.LocalReport.ReportPath = "CompletedProjects.rdlc"
Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("v_ProjectList_v_ProjectList", ObjectDataSource2))
Me.ReportViewer1.LocalReport.Refresh() End Select
End Sub
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply