Printing with Report Viewer with report from report server

1 Answer 85 Views
Report Viewer - WPF
Kathrine
Top achievements
Rank 1
Kathrine asked on 08 May 2023, 04:02 AM

We have a  WPF desktop application that displays reports using the report viewer and we also have our own print dialog where the user can input the number of copies to be printed. The print dialog also gets the default printer configured in our app. Previously, we display and print using InstanceReportSource but we want to now use Report Server for more consistent reports. We have successfully displayed the report from the report server in the report viewer but having problems with printing. Is there a way to override the print dialog of the report viewer or at least pass the parameters that we want (number of copies and default printer)? Another way that we are thinking of is if there is a way to extract the report from the report viewer and use that for our print dialog but ReportViewer.Report is null even though it is displaying the report.

 

Telerik.Reporting, Telerik.ReportViewer.Wpf (15.2.21.1110)

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 10 May 2023, 11:30 AM

Hello Kathrine,

Thank you for the provided information!

If I understand correctly, it will be enough if you are able to modify the PrinterSettings in order to specify the copies and the default printer, is that correct?

If so, in order to do it, you may override the WPF Report Viewer's PrintBegin event. The second argument of the event is an instance of the PrintBeginEventArgs class which exposes a property named PrinterSettings that you may use to set up the printing operation as needed.

Please test this approach and let me know if that helps.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Kathrine
Top achievements
Rank 1
commented on 10 May 2023, 09:27 PM

Hi Dimitar,

Thanks, will try this and let you know 

Tags
Report Viewer - WPF
Asked by
Kathrine
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or