Custom Toolbar (ReportModelViewer missing)

7 posts, 0 answers
  1. Kevin
    Kevin avatar
    112 posts
    Member since:
    Jul 2011

    Posted 19 Dec 2014 Link to this post

    ReportModelViewer missing?

    Up until this point I have been triggering the ReportViewer Commands (MoveToNextPageCommand, MoveToLastPageCommand, etc...) through the ReportViewerModel in an WPF application. I am using the commands this way because we have a customer menu from which we are triggering the commands and so simply editing the template for the ReportViewer will not serve the intended purpose.

    I have just upgraded to Q3 2014 (latest) from Q2 2014 and I am now unable to get to the ReportViewerModel from WPF. Has an alternative access method for the commands been developed and I'm just missing it? I must have access to the commands for the application that I have here. I upgraded because in order to really get a nice UI I needed to be able to find out when the report rendering was complete so that I could get an accurate complete page count and set up some other things, but as of now it appears to have come at the cost of my custom toolbar failing.
  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 23 Dec 2014 Link to this post

    Hello Zack,

    As of Q3 2014, the WPF ReportViewer's ReportViewerModel is internal and should not be used. Instead you can use the exposed viewer's API.


    In addition, as of Q1 2014 Telerik Reporting WPF/Silverlight ReportViewer controls use only implict styles. For more details please refer to the Setting a theme of the WPF/Silverlight Report Viewer (Q1 2014 and later) blog post and How to: Add report viewer to a WPF application help article.

    The only files related to the the viewer are the Telerik.ReportViewer.Wpf.xaml (from the proper theme - C:\Program Files (x86)\Telerik\Reporting Q3 2014\Wpf\Themes) and Telerik.ReportViewer.Wpf.dll. The rest assemblies can be the full binaries of Telerik UI for WPF.


    If you need further help, please open a support ticket and send us a demo project illustrating your settings.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Kevin
    Kevin avatar
    112 posts
    Member since:
    Jul 2011

    Posted 23 Dec 2014 in reply to Stef Link to this post

    So, just to make sure that I am understanding. You have completely removed the ability to access the report controls from outside of the viewer? This was a bit of a juggling act to start with, but at least it has proven possible up to this point.
  4. Kevin
    Kevin avatar
    112 posts
    Member since:
    Jul 2011

    Posted 23 Dec 2014 Link to this post

    To clarify, the API at the provided link offers no access to navigate the report to the next or previous page, first page, last page, etc... Are plans in the works to add access for these commands, or is just gone with no planned replacement?
  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 24 Dec 2014 Link to this post

    Hi Zack,

    You can use the CanMoveToPage, NavigateBack, NavigateForward, TotalPages and CurrentPage methods and properties from the WPF ReportViewer API.

    If you need further help, feel free to open a support ticket and send us a demo project illustrating your scenario and current settings.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Kevin
    Kevin avatar
    112 posts
    Member since:
    Jul 2011

    Posted 30 Dec 2014 in reply to Stef Link to this post

    I've taken a route that better matches your suggestions, but ran into something else. Subscribing to the Report Viewer's "PrintBegin" event results in  the print dialog being shown prior to the event. I know that the dialog can be easily bypassed if you simply provide correct printerSettings, the problem is that I need to know when the user has opted to print in order to present a custom dialog and offer my advanced print options. Subscribing to an event that takes place after the dialog is no use in this scenario and I can't set up the report processing to print programmatically until the user clicks the print button.

    I noticed that the ExportBegin event has been updated to avert this very thing and trigger the event prior to display of the dialog. Is there something I'm missing that offers the same ability to know when the printing is pressed, and not after the dialog has been displayed?
  7. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 02 Jan 2015 Link to this post

    Hello Zack,

    The PrintBegin event must fire prior to displaying the dialog. The issue is reproducible in the latest available internal build, thus we logged it for improvement.

    Your Telerik points are updated to thank you for pointing the problem to our attention.

    Since you are building custom UI to substitute the default Toolbar, you can call the viewer's API - PrintReport and ExportReport methods, after the rendering of the report in the viewer is done (OnRenderingEnd). If you want to use your own dialogs for both operations, you can use the ReportProcessor from your custom UI (PrintReport and RenderReport methods).


    I hope the provided information is helpful.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top