Hi
I've built a module that uses the ms reportviewer control to display a report (containing daily data) and a 'month end' subreport.
Reporting services versions
10.0.1600.22 - live
10.0.2531.0 - dev
As the form loads, I build a collection of parameters using ....
Dim oRptParams(4) As ReportParameter
oRptParams(0) = New ReportParameter("PortalID", PortalId)
oRptParams(1) = New ReportParameter("ModuleID", ModuleId)
oRptParams(2) = New ReportParameter("BranchCode", sStoreCode)
oRptParams(3) = New ReportParameter("SelectedMonth", iSelectedMonth)
oRptParams(4) = New ReportParameter("SelectedYear", iSelectedYear)
(all contain valid values at runtime)
I then add a SubReportProcessing event handler.
AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf Me.SubReportProcessingEvent
Pass the collection of parameters to the report
ReportViewer1.LocalReport.SetParameters(oRptParams)
ReportViewer1.LocalReport.Refresh
As the report builds itself, the subreport processing event does fire, which sets up a new ReportDataSet.
Sub SubReportProcessingEvent(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
'Pass subreport datasource into report
Dim oDsRpt As ReportDataSource = New ReportDataSource("dsPrescriptionCount_PrescriptionCountMonthEnd", ObjectDataSource2)
e.DataSources.Add(oDsRpt)
End Sub
Note: The definition for ObjectDataSource2 is on the page. None of the data is coming from any of the std dnn tables, the subreport uses its own two custom tables.
The module runs fine and the subreport displays ok on IIS on the dev box but when deployed to the live server, the subreport is not shown & the message "Error: Subreport could not be shown" is displayed by the report viewer. The report file does exist, the permissions look ok. The rest of the app works fine and it can update and edit the table data using the new module. The main report runs ok but the subreport wont.
As I say, it all works fine on the 05.02.01 (community) dev box browsing with IE on IIS, (or using the visual studio IDE)
BUT the month-end subreport fails to display when it's installed on the live 05.04.01 (pro) box.
The ref to the relavant http handler, Reserved.ReportViewerWebControl, has been added to the web.config file on both machines.
Completely stumped by this, any help much appreciated ..........
btw: Is this the right forum, or should I be in SQL ???
Cheers - Guy