How to avoid empty tables in the Word and PDF output


It is quite common for the documents generated with RPE to include tables and just as often the content of those tables is dynamic, based on the results of a query. Typically these tables have one header row which contains the labels of the data. In these circumstances if there is no data to populate the body of the table output will contain only the empty shell of the table or a table having only the header row.

Both outcomes are usually not desirable and have to be dealt with. Excluding macro based solutions, prior to 1.2.1.1 the only way to avoid empty tables for the Word/PDF output was to programmatically exclude the table using variables and JavaScript.

RPE 1.2.1.1  offers a new table property called “remove if empty” which when set to true will cause the table to be removed from the output if it has no rows or has only header rows.

removeIfEmpty

NOTE: the property’s default value is false to ensure older templates ran in 1.2.1.1 produce the same output as the older RPE versions.

The property can also be applied to table rows to avoid rows with no cells.

Advertisements

Author: Dragos Cojocari

Architect for Rational Publishing Engine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s