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

Set WPF ReportViewer printer

5 Answers 209 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Micheal
Top achievements
Rank 1
Micheal asked on 23 Apr 2013, 10:10 PM
I'm doing a very large LOB WPF MVVM .Net 4.5 app, using Telerik WPF controls (2012.3.1129.45) and Reporting (Q3 2012 6.2.12.1017).

Our LOB app requires us to send certain reports to certain configured printers on the network. When printing only, I'm using a ReportProcessor to successfully send off the report to the correct printer, no Print Dialog required, everything's great! But, we need to do the same thing when the user has previewed the report in a WPF ReportViewer and presses the Print button. 

After doing a lot of investigation, the WPF ReportViewer doesn't seem to expose any of its ReportViewerModel ReportProcessor or PrinterSettings properties for us to be able to change anything. Is there any way to set the printer?

At this point, it looks like our only hope is to completely remove the ReportViewer toolbar and attempt to create our own toolbar that can control the ReportViewerModel in every way except when we print we can go to our own ReportProcessor. I'm not sure if this is feasible, because I'm not sure of the parameters of some of the ReportViewerModel commands take since they are not documented.

This seems like a whole lot of work, for something that should be as simple as setting a ReportViewer printer. Can you help? Do you have any other suggestions or ways to achieve this functionality?

5 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 26 Apr 2013, 01:49 PM
Hello Micheal,

It seems that the issue you are having has an easier resolution. Since the report viewer has a theme that can be edited in Expression Blend (for more information please check this help article) you can actually extract it and then modify it. This will give you the option to hide the original print button and place your own print button which will be handled by your implementation.

I hope that helps.

Greetings,
IvanY
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
tung ngie
Top achievements
Rank 1
answered on 23 Aug 2013, 06:32 AM
Hi IvanY

I am using latest reporting for trial.
I have create a copy of the style using Expression Blend. After modification, i realize the BorderBrush, background and foreground are set to particular colors already.

Is there any way i can make changes to the style so that they will follow colors according to the theme set for the report viewer?

Thanks
tungngie

EDIT: (just an addon)
The modification I made to the style is to style the parameter area, and modify the icons of the toolbar so that they are consistent with the UI in the main application. (The report viewer is on a separate dialog.)
After making the modification, the colors are fixed and can't be set to follow the theme's.
Please help~
Thank you.
0
KS
Top achievements
Rank 1
answered on 28 Aug 2013, 09:27 AM
Hi,

You can bind borders and backgrounds to brushes defined by you.
Consider the examples here: http://www.codeproject.com/Articles/18388/A-Guided-Tour-of-WPF-Part-5-Styles

    - KS
0
tung ngie
Top achievements
Rank 1
answered on 31 Oct 2013, 12:54 AM
Hi K S

I actually want to use those brushes in the Theme, not the ones i defined.
I have done it by doing loading the theme resource dictionary and merged into the window's merged resource dictionary. The brushes in the theme can be gotten by using DynamicResource.

Let me know if there is better solution.

Thanks
tungngie
0
KS
Top achievements
Rank 1
answered on 04 Nov 2013, 10:54 AM
Hi,

Maybe an application theme: http://www.telerik.com/community/forums/wpf/general-discussions/how-can-i-create-a-custom-theme-for-wpf-application.aspx.

Still borders brushes and etc have to be changed to point to the resources manually.

   - KS
Tags
General Discussions
Asked by
Micheal
Top achievements
Rank 1
Answers by
IvanY
Telerik team
tung ngie
Top achievements
Rank 1
KS
Top achievements
Rank 1
Share this question
or