Zee
Zee

Reputation: 15

Hide Page if it does not have line items to be printed in rtf file

enter image description hereI'm building a custom print using BIP desktop add-in words and there are two pages. the first page is general information and the second page comes from line items (application used Unifier).

Line items may not have information and I was trying to find a way NOT to print it if there is no data entered into line items.[enter image description here][2]

How to hide or not to print a page in rtf file if it does not have information?

Thanks

Zee

Upvotes: 0

Views: 1541

Answers (1)

EdHayes3
EdHayes3

Reputation: 1953

Should be able to use an if statement with a count function containing a condition. Put the if statement before the page break. In this example I'm checking if the INFORMATION element is not blank and counting the instances of it.

<?if:count(LIST_ROW/ROW[INFORMATION!=''])>0?>
...CONTENT...
<?end if?>

Example

Template enter image description here

XML

<list_record>
<record>
<record_id>A</record_id>
<list_information>
<information>
<key>1</key>
<value>one</value>
</information>
<information>
<key>2</key>
<value>two</value>
</information>
</list_information>
</record>
<record>
<record_id>B</record_id>
<list_information>
<information>
<key>1</key>
<value></value>
</information>
<information>
<key>2</key>
<value></value>
</information>
</list_information>
</record>
</list_record>

Upvotes: 0

Related Questions