Reports for WPF | ComponentOne
Task Based Help / Customize Page Layout / Creating a Gutter Margin
In This Topic
    Creating a Gutter Margin
    In This Topic

    Gutter margins are extra space added to the margins next to the binding. They make it easier to bind the pages into folders, brochures, and so on.

    To add a gutter margin to a report, you should increase the C1.C1Report.Layout.MarginLeft property on odd pages and use the default value on even pages. This can be done with script. To add script that changes the margins based on the page being rendered, complete the following steps:

    Open the C1ReportDesigner application. For more information on how to access C1ReportDesigner, see Accessing C1ReportDesigner from Visual Studio.

    1. Create a new report|tag=Creating a Basic Report Definition or open an existing report. Once you have the report in the C1ReportDesigner application, you can modify the report properties.
    2. Click the Close Print Preview button to begin editing the report.
    3. In Design mode, select Detail from the drop-down list above the Properties window.
    4. Locate the C1.C1Report.Section.OnPrint property and click the empty field next to it, and then click the ellipsis button.
    5. The VBScript Editor appears. Enter the following VBScript expression in the code editor:

    ' VBScript: Report.OnOpen

    gutter = report.layout.marginleft ' initialize variable

    ' VBScript: Report.OnPage

    report.layout.marginleft = _

      Iif(page mod 2 = 1, gutter, gutter - 1440)

    Note:  For the complete report, see report "10: Gutter" in the CommonTasks.xml report definition file, which is available for download from the CommonTasks sample on the ComponentOne HelpCentral Sample page.
    See Also