I have an application where the user specifies # of copies, collation, etc. in their profile for different reports to save time when they print the report. When a user selects a report, I have them displaying in the ReportViewer. Is it possible to define these print settings in the ReportViewer so when they click the print button it automatically uses these settings and prints the report with # of copies, collation, etc. already preconfigured?
6 Answers, 1 is accepted
To implement some custom printing logic you can handle the Print event of the ReportViewer component. Since this event supports cancellation you can disable the default printing logic of the viewer and replace it with your own implementation instead. For manual printing you can use the PrintReport method of the ReportProcessor class which allows you to pass the PrinterSettings as a parameter. Here is a small sample code snippet that demonstrates how to do this:
I hope this is helpful enough to implement your custom printing. If you have some additional questions regarding this topic, please do not hesitate to ask.
the Telerik team
My available event is just RenderBegin.Event
How can you use the same event? I'm facing the same problem, and I'm planning to use this solution.
The event is suitable for the Windows Forms viewer as the printing occurs on the same machine which would print the reports. When you're using Silverlight, the viewer is on the client, while the reports are being printed on the server. There is no out of the box way to change the printersettings when printing from the Silverlight report viewer's print button, and if you need such functionality you should handle the printing yourself.
How to utilize our report service to retrieve the rendered report and invoke the Silverlight print API is elaborated in the following forum post.
Additionally you may find useful the System.Windows.Printing MSDN article.
the Telerik team
I have facing an issue at the time print report called, The issue is delayed to excecute PrintReport as it is taking approx 1.3 secs which is huge time.
Could you please have a look on below code?
public static bool Print(Telerik.Reporting.IReportDocument document, string printerName, short copies)
ReportProcessor processor = new ReportProcessor();
System.Drawing.Printing.PrintController controller = new System.Drawing.Printing.StandardPrintController();
processor.PrintController = controller;
System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();
printerSettings.PrinterName = printerName;
printerSettings.Copies = copies;
printerSettings.Collate = false;
var repSource = (Telerik.Reporting.InstanceReportSource)document.Reports.FirstOrDefault();
Realy appreciate your inputs here and looking hear from you soon. Thanks!