cancel
Showing results for 
Search instead for 
Did you mean: 

How to set printer output tray using PrintOptions?

Former Member
0 Kudos

Post Author: Joel

CA Forum: .NET

hi,

I know we can set papersource to let the printer know where to get the paper from.

However, if I want to specify which tray the printer should spit out the print result (output tray), how can I do this using PrintToPrinter() function?

is there a property that I can use in the PrintOptions object?

or if anyone know how to convert from CrystalDecisions.CrystalReports.Engine.ReportDocument into System.Drawing.Printing.PrintDocument?so that I can just use PrintDialog object.

btw, using print function from CrystalReportViewer is not an option for me.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Post Author: Afzal

CA Forum: .NET

From the documentation for CRXIR2 in C#,PrintDocument pd = new PrintDocument();pd.PrinterSettings.PrinterName = "HP LaserJet 4100 Series PCL";

CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();rd.Load(@"C:\Documents and Settings\xyz\My Documents\Visual Studio 2005\Projects\WindowsApplication11\r1.rpt");rd.PrintOptions.PrinterName = "HP LaserJet 4100 Series PCL";rd.PrintOptions.CustomPaperSource = pd.PrinterSettings.PaperSources[3];rd.PrintToPrinter(1,false,0,0); Note you need a PrintDocument object to get the list of valid PaperSources for that particular Printer. First set the printer name, etc. etc.Note, this does not work for non-standard paper sizes.

Answers (1)

Answers (1)

Former Member
0 Kudos

Post Author: ole

CA Forum: .NET

Sorry, he was looking for paper destination, not for paper source. I am looking for it, too. No idea how to do it. Same problem is my long existing wish for CustomPaperSize. I think at least CustomPaperSize should be a standard feature of a reporting tool.