Search website

How to Print to another Printer

The following code allows developer to make the system to print another copy of the report on another printer. Please place the script in the Report Tool script under the Application Category in Script Maintenance (as shown below)

The script is to be place here

The script is to be place here

Code Snippet
  1. const string PrinterName = “Microsoft XPS Document Writer”;
  2. ///<summary>
  3. /// Occurs after a report is printed
  4. ///</summary>
  5. ///<param name=”e”>The event argument</param>
  6. public void AfterPrint(BCE.AutoCount.Report.ReportTool.AfterPrintEventArgs e)
  7. {
  8.     if (e.ReportType == “Invoice Document”)
  9.     {
  10.         if (e.PrintFix.PrinterSettings != null)
  11.             e.PrintFix.PrinterSettings.PrinterName = PrinterName;
  12.         else
  13.             e.PrintFix.PrinterName = PrinterName;
  14.         e.Print();
  15.     }
  16. }