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

Custom Toolbar (ReportModelViewer missing)

8 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Guru
Top achievements
Rank 2
Guru asked on 20 Dec 2014, 02:26 AM
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.

8 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 23 Dec 2014, 05:09 PM
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.

 
0
Guru
Top achievements
Rank 2
answered on 23 Dec 2014, 05:17 PM
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.
0
Guru
Top achievements
Rank 2
answered on 23 Dec 2014, 05:48 PM
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?
0
Stef
Telerik team
answered on 24 Dec 2014, 11:07 AM
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.

 
0
Guru
Top achievements
Rank 2
answered on 30 Dec 2014, 03:05 PM
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?
0
Stef
Telerik team
answered on 02 Jan 2015, 09:07 AM
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.

 
0
Heiko
Top achievements
Rank 1
Iron
Veteran
answered on 29 Nov 2020, 03:50 PM

The link that has been mentioned that should be a documention of exposed viewer's API is no longer valid:

http://www.telerik.com/help/reporting/allmembers_t_telerik_reportviewer_wpf_reportviewer.html

Where can I find this?

0
Dimitar
Telerik team
answered on 30 Nov 2020, 02:53 PM

Hi Heiko,

The documentation for the WPF ReportViewer can be found at -  ReportViewer Class (WPF). You might also find helpful the WPF Application article.

Please, let us know if you have any questions.

Regards, Dimitar Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Guru
Top achievements
Rank 2
Answers by
Stef
Telerik team
Guru
Top achievements
Rank 2
Heiko
Top achievements
Rank 1
Iron
Veteran
Dimitar
Telerik team
Share this question
or