Hi everyone !
I currently have a main report makes navigation in another report at the click of a button.
I need to recover the ReportSource raports towards which I navige . Unfortunately my ReportSource does not change and remains one of my main report. How to solve this problem?
Best regards,
Julien ZARNIAK
4 Answers, 1 is accepted
I am not sure what you mean by recovering the ReportSource.
Please provide more details on the problem. Also you might find useful the Actions help articles.
Regards,
Nasko
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Hi Nasko and thanks for your reply.
We are using Wpf Report Viewer in our application. One of our reports use navigation (when the user click on a specific cell, we navigate to another report source). The navigation works well, but when we have navigated to the second report, the ReportSource of the WPF ReportViewer is still the ReportSource of the initial Report.
Why the source is not updated ?
How to get the parameters of the "navigated" report of the report viewer.
Best regards,
Julien
The report source property of the viewer will not change when navigating to a different report. To pass parameters to the navigated report you need to use the ReportSource.Parameters Property of the NavigateToReportAction.ReportSource. You can also use the NavigateToReportAction.ReportSource Property to retrieve the navigated report definition and review it.
Regards,
Nasko
Telerik
See What's Next in App Development. Register for TelerikNEXT.
we finally find a solution to retrieve the ReportSource once we have navigated to another report.
We use the following code :
Grid grid = this.ReportViewer.ChildrenOfType<Grid>().First(); Type type = grid.DataContext.GetType(); PropertyInfo propertyInfo = type.GetProperty("ReportSource"); TypeReportSource source = (TypeReportSource)propertyInfo.GetValue(grid.DataContext); NavigateToReportAction nra = newNavigateToReportAction() ; nra.ReportSource = (ReportSource)this.ReportViewer.ReportSource; if (source.Parameters.Contains("WorkOrderId")) { Int32 id = (Int32)source.Parameters["WorkOrderId"].Value; }
Do you know a better way because ReportViewerModel is not public so we must use reflection.
Best Regards,
Julien