Perhaps I am not doing this correctly so please tell me if there is a better way to accomplish this as I am not ties to this method.
What I need is a way to allow a user to choose the report to run. Once the report is chosen I pull the igr file, parse out what parameters are needed and then generate a more user friendly selection control based on the data type (such as a datpicker for date field). The problem I run into is that I have the XamReportViewer bound to a ComboBox that lists all the reports so as the user selects the report the report viewer updates and I get an error that the new report does not contain a parameter called XXXXX. I tried clearing out the parameters in the combobox onchanged event but it must fire after the report viewer is updated.
<ig:XamReportViewer Name="xamReportViewer" PageFit="Width" Grid.Row="1"> <ig:XamReportViewer.RenderSettings> <ig:ServerRenderSettings ServiceEndpointUri="/ReportService1.svc/soapAddress/" DefinitionUri="{Binding ElementName=reportlist,Path=SelectedItem.Value}" /> </ig:XamReportViewer.RenderSettings> </ig:XamReportViewer>
Is there a sample on how to dynamically load reports and parameters? Is this the proper approach and if so how do I reset the parameters once a new report is selected or do I have to manually update the DefinitionUri in the onChanged event as well?
Hello Mike,
Thank you for your post. I have been looking into it and I have created a sample application for you, that demonstrates how you can change the report displayed in the XamReportViewer and its parameters, based on the SelectedItem of a ComboBox.
If you need any further assistance on the matter please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support