Preventing an Empty Static Table from Printing on a Report

How to prevent an empty static table from printing on a report

If you have a form that contains a static table that isn't always populated, you may not want the table to print on the report when the table is empty. This can be helpful when you have a simple form. Typically, you'd probably have a form with conditions and based on answers information prints on a report. However, maybe your form just has one static table that techs can skip over when it's not applicable and you don't want that information to print on the report.

To prevent an empty static table from printing on a report, complete the following.

  1. In the Form Designer, click (Reports) and select your report to open the Report Designer.
  2. Double-click on the sub-table (in this example, If_confined_space_complete_requirements) to open the Report Designer for the sub-table.
  3. Click on each form answers cell, then click (Properties) from the right-hand side of the Report Designer.
  4. Expand the Behavior property and mark Can Grow, Can Publish, Can Shrink, Keep Together, and Visible. Then select Suppress and Shrink from the Process Null Values field.
  5. Complete this step for each form answers cell.
  6. Click each of the table row's label field, then click (Expressions) from the right-hand side of the Report Designer. 
  7. Expand the Before Print section.
  8. Click the three dots in the Visible field to open the Expression Editor.
  9. Enter a !IsNullOrEmpty expression. So, in this example, you would enter: !IsNullOrEmpty([Form Answers.If_confined_space_complete_requirements_1_LockoutTagout_Column_2])
    then click Apply.
  10. Click OK.
  11. Complete this step for each table row's label. 
  12. If the static table has a label, you can use the same expression from one of the static table's row label by completing the same steps. Click the static table label.
  13. Expand the Before Print section.
  14. Click the three dots in the Visible field to open the Expression Editor.
  15. Enter a !IsNullOrEmpty expression. So, in this example, you would enter: !IsNullOrEmpty([Form Answers.If_confined_space_complete_requirements_1_LockoutTagout_Column_2])
    then click Apply.
  16. Click OK
  17. Save the changes made and close the sub-report.
  18. Save the changes made in the Report Designer and close the Report Designer.
  19. Click(Save) in the Form Designer to save the changes made.
  20. Now, if you don't populate the table, it will not print on the report when the form is submitted.
    In the following illustration notice no confined space information has been entered in the static table on the form:
  21. The form has been submitted and the empty static table doesn't print on the report.

FormsPro Report Designer uses DevExpress tools to create reports. For detailed information about DevExpress, see DevExpress Documentation.