Hello,
I started off with the ReportCatalog used in the CSharp.ReportExamples.VS2010 solution from which reports hosted in an asp.net class library are loaded. I went ahead and created a custom parameter UI above my Silverlight reportviewer, but i cannot seem to get the target report (using the Navigate to Report action) to receive the passed parameters from the custom ui. I can navigate to the reports but only the default parameter values set for the reports are used. I have tried using the RenderBegin method but it seems the passed parameters are being ignored. I have read a number of blogs on this, but somehow, things are not working.
How can I wire up the parameters from my Silverlight application to the reports?
Below are snippets of my code:
<
my1:ReportViewer
Name
=
"rptViewer"
…..
Report
=
"XXX.ReportsLibrary.ReportCatalog, XXX.ReportsLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
ReportServiceUri
=
"../Services/ReportService.svc"
RenderBegin
=
"rptViewer_RenderBegin"
Loaded
=
"rptViewer_Loaded"
/>
In the code behind of the page hosting the reportviewer, I have:
void rptViewer_RenderBegin(object sender, RenderBeginEventArgs args)
args.ParameterValues.Clear();
args.ParameterValues["dateStart"] = rdpStart.SelectedDate;
args.ParameterValues["dateEnd"] = rdpEnd.SelectedDate;
((ReportViewerModel)(rptViewer.DataContext)).ApplyReportParametersCommand.Execute(null);
}
One thing I noticed is that the sender is ALWAYS the ReportCatalog. I was expecting that after navigating to ReportX the Sender would be ReportX. So is it that I am trying to apply parameters to the wrong report?
Please help!!!
My last option would be to abandon the idea of custom parameters UI.
Thanks