Reports for WinForms | ComponentOne
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 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:

    1. Open the C1ReportDesigner. For more information on how to access the C1ReportDesigner, see Accessing C1ReportDesigner from Visual Studio.
    2. Create a new report or open an existing report. Once you have the report in the C1ReportDesigner, you can modify the report properties.
    3. Click the Close Print Preview button to begin editing the report.
    4. In Design mode, select Detail from the drop-down list above the Properties window.
    5. Locate the OnPrint property and click the empty field next to it, and then click the ellipsis button.
    6. 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 in the ComponentOne Samples folder.