Setting TfrxReport.PrintOptions.PrintOnSheet In Code
I'm trying to print a report multiple times on a single page. If I set TfrxReport.PrintOptions.ShowDialog = true and pick the sheet I need to use (Letter) from the dialog everything works as expected.
However, I need to bypass the dialog, set the sheet in code and just print the report.
How do you set TfrxReport.PrintOptions.PrintOnSheet in code?
Any suggestions?
However, I need to bypass the dialog, set the sheet in code and just print the report.
How do you set TfrxReport.PrintOptions.PrintOnSheet in code?
Any suggestions?
Comments
Thank you so much. That worked perfectly.
Is there a reference for what values to use with PrintOnSheet?
Thanks again. Found the source file - frxLazPrinters.inc for anyone looking at this thread. The pages are defined in increments of 0.1 mm. The Letter (or 8.5" x 11") is 2159 x 2794 or 215.9 mm x 279.4 mm which converts to 8.5" x 11".
Here's a helpful resource on paper sizes: http://www.papersizes.org/
Using 0 seems to set PrintOnSheet to the PaperSize, PaperHeight and PaperWidth property from the report. The values of TPaperInfo[0] might be the default values for a new report but they are not necessarily what's used if you set PrintOnSheet to 0 - correct?
If PrintOnSheet is set to 4 for Legal size paper and that paper is not available at the printer, PrintOnSheet is automatically set to 0 and the values of PaperSize, PaperHeight and PaperWidth are used. This is true for any paper type that is not available.
The point is just a heads up for anyone looking at this thread, setting PrintOnSheet to values not supported by a printer does not help you figure out if you're picking the correct indexes into TPaperInfo.