How to prevent an empty sub-table in a sub-table from printing on a report
You may have a report that has a sub-table in a sub-table, such as a dynamic table in a dynamic table. There might be instances when portions of the sub-table are blank, and you don't want an empty table to print on a report. For example, let's say you have a form that lists people who have applied for jobs along with their education background. An applicant may not populate every field, and you want to prevent empty tables from printing on your report.
FormsPro Report Designer uses DevExpress tools to create reports. For detailed information about DevExpress, see DevExpress Documentation.
To prevent an empty sub-table from printing on a report, complete the following.
- In the Form Designer, click (Reports) and select your report to open the Report Designer.
- Double-click on the sub-table (in this example, Candidate) to open the Report Designer for the sub-table.
- Click on each detail sub band that you want to suppress an empty sub-table on (in this example, Candidate_Education_Extra_Curricular_Clubs), then click (Properties) from the right-hand side of the Report Designer.
- 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.
- Complete this step for each detail sub band.
- Click each of the sub-table's label field, then click (Expressions) from the right-hand side of the Report Designer.
- Expand the Before Print section.
- Click the three dots in the Visible field to open the Expression Editor.
- Enter a IsNullorEmpty expression. So, using label7 in this example, you would enter IsNullorEmpty([ReportItems.label7]), then click Apply.
- Click OK.
- Complete this step for each table row's label.
- Save the changes made and close the sub-report.
- Save the changes made in the Report Designer and close the Report Designer.
- Click(Save) in the Form Designer to save the changes made.
- Now, if you don't populate the sub-table, it will not print on the report when the form is submitted.
In the following illustration notice no extra-curricular/club information has been entered for Lucy Monroe in the sub-table on the form: - The form has been submitted and the empty sub-table doesn't print on the report.