How to use printer, that is not default in system.

Stimulsoft Reports.NET discussion
Post Reply
Stanly Bach
Posts: 1
Joined: Tue Jul 04, 2006 7:23 am

How to use printer, that is not default in system.

Post by Stanly Bach »

Hello!
How can I print my report on the printer, that is not default in my system?
Thank you in advance for help.
GarryGlobe
Posts: 2
Joined: Tue Jul 04, 2006 7:38 am

How to use printer, that is not default in system.

Post by GarryGlobe »

Stanly wrote:Hello!
How can I print my report on the printer, that is not default in my system?
Thank you in advance for help.
You should specify the printer name in the PrinterName property of the PrinterSettings class. For example:

Code: Select all

      StiReport report = new StiReport();
      report.Load("MyReport.mrt");
      report.RegData(myDataSet);
      report.Render();

      //Create Printer Settings
      PrinterSettings printerSettings = new PrinterSettings();

      //Set Printer to Use for Printing
      printerSettings.PrinterName = "MyPrinterName";

      //Direct Print - Don't Show Print Dialog
      report.Print(false, printerSettings);
Thanks!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to use printer, that is not default in system.

Post by Edward »

Stanly wrote:Hello!
How can I print my report on the printer, that is not default in my system?
Thank you in advance for help.
You should specify the printer name in the PrinterName property of the PrinterSettings class. Please use following code:

Code: Select all

      StiReport report = new StiReport();
      report.Load("MyReport.mrt");
      report.RegData(myDataSet);
      report.Render();

      //Create Printer Settings
      PrinterSettings printerSettings = new PrinterSettings();

      //Set Printer to Use for Printing
      printerSettings.PrinterName = "MyPrinterName";

      //Direct Print - Don't Show Print Dialog
      report.Print(false, printerSettings);
Thanks!
Post Reply