Creating an option to display the report header

In some cases, you might want to display the report header page when you print the report. In other cases, you might not want to display it. You can provide users the option whether to display it or not, using a check box on the report criteria form.

Note: This procedure applies only to report criteria forms created in the Windows client. Because of significant differences, we do not recommend trying to perform this procedure in the web client Web Designer.

To create an option to display the report header on report outputs:

  1. Open the report criteria form and go into Design Mode.
  2. Add a CheckBox component to the form and name it DisplayReportHeaderCheckbox.
  3. For the Caption, use sDisplayReportHeader, creating the translatable string if necessary.
  4. Bind the component to a variable that will be used to pass the parameter value:
    1. Click the ellipsis (•••) button associated with the Data Source > Binding property.
    2. In the Edit Component Data Binding dialog box, for the Type, select Variable.
    3. Click Edit.
    4. In the Edit Variable Binding dialog box, from the Variable drop-down list, select or create a variable named DisplayReportHeader.
      Note: If you have not already created the variable, you can type the name for the variable into the Variable field, and the variable is created when you exit the dialog box.
    5. Optionally, to have the check box selected by default, set the Initial Value to 1.
    6. Click OK in each dialog box until you are returned to the form.
  5. Add a SETVARVALUES clause to the BGTaskParms variable:
    1. Still in Design Mode, select Edit > Variable.
    2. In the Variables dialog box, select the BGTaskParms variable and click Edit.
    3. Add this SETVARVALUES clause to the Value field: SETVARVALUES(DisplayReportHeader=V(DisplayReportHeader))
    4. Click OK and then click Done.
  6. Save and close the report criteria form.
  7. Open the report template form and go into Design Mode.
  8. Click inside the space near the bottom of the form and verify that the MainFlexLayout component is selected.
  9. Click the Edit FlexLayout button, which is located just inside the upper left corner of the MainFlexLayout component.
  10. In the Edit FlexLayout Attributes dialog box, select the region that is designated for the Report Header.
    This region typically has an Index of 0 (zero).
  11. In the region properties panel (on the right side of the dialog box), expand the Behavior set of properties and click the ellipsis (•••) button for the VisibleWhen property.
  12. In the Edit Condition dialog box, create the condition:
    1. Click Edit Left Value.
    2. In the Edit Value Expression dialog box, set Value Type to Variable Value and for the Value, specify DisplayReportHeader.
    3. Click OK.
    4. Click Edit Right Value.
    5. In the Edit Value Expression dialog box, set Value Type to Literal, and for the Value, specify 1.
    6. Click OK.
    7. Verify that the VisibleWhen expression displays in the field.
      Note: Performing this step normally causes the Report Header to not display, even in Design Mode. That being the case, the system now displays a new property option (Visible in Design Mode) in the region properties list.
  13. Set the Visible in Design Mode property to True.
    This allows the report header region to display in Design Mode, without displaying in Runtime Mode.
  14. In the Edit FlexLayout Attributes dialog box, click OK.
  15. Save and close the report-template form.
  16. Refresh the metadata cache and reopen the report criteria form.
  17. Test the report and verify that the report header displays when it should and does not display when it should not.