Printer and Page Settings (Section Reports)
In Section reports, you can set the printer paper size and report margins at run time in the Report Settings dialog. All of these settings are in the first page, Page Setup, and the second one, Printer Settings. You can also modify these settings using the SectionReport class's PageSettings property. The PageSettings class lists all of the properties that you can modify, including Collate, Duplex, Gutter, and MirrorMargins. The example code below sets the following printer and page properties.
- Paper: A3
- Orientation: Landscape
- Top margin: 0.5
- Bottom margin: 0.5
- Left margin: 0.7
- Right margin: 0.7
' Visual Basic
' Set the printer paper size to A3 and the page orientation to Landscape.
rpt.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
rpt.PageSettings.Orientation = GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape
' Set the top, bottom, left, and right report margins.
rpt.PageSettings.Margins.Top = 0.5
rpt.PageSettings.Margins.Bottom = 0.5
rpt.PageSettings.Margins.Left = 0.7
rpt.PageSettings.Margins.Right = 0.7
'Run the report.
rpt.Run(False)
// C#
SectionReport1 rpt = new SectionReport1();
// Set the printer paper size to A3 and the page orientation to Landscape.
rpt.PageSettings.PaperKind= System.Drawing.Printing.PaperKind.A3;
rpt.PageSettings.Orientation = GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape;
// Set the top, bottom, left, and right report margins.
rpt.PageSettings.Margins.Top = 0.5f;
rpt.PageSettings.Margins.Bottom = 0.5f;
rpt.PageSettings.Margins.Left = 0.7f;
rpt.PageSettings.Margins.Right = 0.7f;
// Run the report.
rpt.Run(false);
For more information about modifying printing options in Section reports, see the following topics in the User Guide.
- Report Settings Dialog
- Troubleshooting (7th item: Viewer shows report on wrong paper size)