Question Changing paper orientation & Size using Crystal report

Hello All,

I am trying to generate PDF & PS file from Progress using Crystal Report (CrystalDecisions.CrystalReports.Engine.ReportDocument).
Using below code PS file always shows default orientation and paper size. I tried many combinations of printerSettings, PageSettings even PrintOptions of ReportDocument, but nothing is working. Except these properties report is being generated in PDF and PS file perfectly.

In PS file I am getting 2 pages while in PDF its 1. Direct print to printer also giving me 1 page output.

Please help me to get some code or reson while its not setting property, what I am setting at run time.

Code:
crwReport = NEW CrystalDecisions.CrystalReports.Engine.ReportDocument().
printerSettings  = new System.Drawing.Printing.PrinterSettings().
printersettings:DefaultPageSettings:Landscape = TRUE.
printerSettings:printerName = "Oce PS3".
printerSettings:printToFile = True.
printerSettings:printFileName = "h:\print\testsports_" + REPLACE(string(time, "HH:MM:SS"), ":", "") + ".PS".
pageSettings = new System.Drawing.Printing.PageSettings().
crwReport:printOptions:CopyTo(printerSettings, pageSettings).
pageSettings:printerSettings:DefaultPageSettings:LandScape = TRUE.
crwReport:printToPrinter(printerSettings, pageSettings, false).
 
Last edited:
Top