A conditional section is a paragraph that is displayed only if a certain condition (derived from the input data) is met. In other words, the element is only rendered if the expression evaluates to a true value.
To understand better consider an example of XML with a collection of CDs. You can display for example sections that fulfill a certain condition (for example title and artist of the albums having prices over 10$ or having a certain year of appearance). In order to do that you need to create a repeating section first because you need for the condition to be tested for each CD.
Go to the Insert tab and choose Repeating Section from the Dynamic Content group. The Edit Expression dialog will be displayed. Select the path to the node you refer (in this example cd) and click OK. In the repeating section insert now a conditional section using the Insert tab.
The Edit Expression dialog will be displayed again. Choose now the condition for your section (for example price>10) and click OK.
Your Design mode should look like in the picture below:
As you can see you have 2 sections you can edit and these are: first one in case of a true value for the condition and the second (a fallback section) in case the condition is evaluated to a false value.
To display titles and artists for the albums having prices over 10$, drag from the Data Source Tree the elements title and artist into the section and choose Field from the menu that appears when you drop each one of them. Customize the fallback section if you need with your preferences. In this case, for the albums with a lower price you can display for example "Special Offer" with a red font. And you can add the title of album and artist too.
Below you can see the result in Design mode and then a preview in PDF format:
Design mode:
PDF result:
Note:
|