Conditional Print sections

You can include or exclude entire Print sections from the output, depending on a field’s value. This can be done using the Conditional Print Section Script Wizard, described below. Alternatively you could write a Control Script (see Control Scripts).

Including or excluding Print sections using the Conditional Print Section Script wizard

  1. Right-click the section and click Make Conditional.
    Alternatively click the black triangle on the New button on the Scripts pane at the bottom left of the window, and click Conditional Print Section Script. Double-click the new script to open the Conditional Print Section Script wizard.
  2. Rename the script so that it reflects what the script does.
  3. Select the section you want to put a condition on.

  4. Set the Action: Print or Skip that is performed when the condition below is true. The opposite action is applied when the condition returns false.
  5. Click the downward pointing arrow next to Datafield, to select the data field that should be evaluated.
  6. Click the downward pointing arrow next to Condition to expand the list of conditions with which the data field can be evaluated. The options are: Equal to, Not equal to, Contains, Does not contain, Begins with, Ends with.
  7. Type the Value or values that should be used for the conditional check. Each additional value should go on a new line. The action is performed if the condition evaluates to true with one of the given values. Values are case sensitive. Dates should be entered in ISO standard notation (yyyy-mm-dd).

    Example
    You could check whether the Province field is 'Equal To' the value Québec, in order to print or skip a section only for customers living in Québec. With these values:
    Québec
    Ontario

    the section will be printed if the Province field reads Québec OR Ontario.

    More complex conditions can be written in the Script Editor: click Expand and edit the code of the script. See Control Scripts.

  8. Click Apply or OK.
  9. To see the result, toggle to the Preview tab at the bottom of the workspace (or select View > Preview View on the menu). Take a look at the Resources pane: on each Print section that is affected by a Conditional Print Section script a small decorator appears, showing whether it will be skipped or printed with the current data record.
 
  • Last Topic Update: 18, September, 2017 09:38 AM
  • Last Published: 23, May, 2019 01:55 PM