Change ReportSource when navigating to another report

5 posts, 0 answers
  1. Julien
    Julien avatar
    7 posts
    Member since:
    Sep 2014

    Posted 14 Apr 2015 Link to this post

    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

  2. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 16 Apr 2015 Link to this post

    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.

     
  3. Julien
    Julien avatar
    7 posts
    Member since:
    Sep 2014

    Posted 20 Apr 2015 Link to this post

    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



  4. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 22 Apr 2015 Link to this post

    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.

     
  5. Julien
    Julien avatar
    7 posts
    Member since:
    Sep 2014

    Posted 01 Jun 2015 in reply to Nasko Link to this post

    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
Back to Top