This is a migrated thread and some comments may be shown as answers.

Change ReportSource when navigating to another report

4 Answers 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 14 Apr 2015, 09:12 AM

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

Sort by
0
Nasko
Telerik team
answered on 16 Apr 2015, 03:59 PM
Hi Julien,

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.

 
0
Julien
Top achievements
Rank 1
answered on 20 Apr 2015, 02:55 PM

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



0
Nasko
Telerik team
answered on 22 Apr 2015, 01:42 PM
Hello 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.

 
0
Julien
Top achievements
Rank 1
answered on 01 Jun 2015, 08:04 AM
Hi Nasko,

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
Tags
General Discussions
Asked by
Julien
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Julien
Top achievements
Rank 1
Share this question
or