Wednesday, 12 March 2014

Conditional Sections In BI Publisher

One issue that was always a major headache for us with Transform was the Terms and Conditions pages which are attached to the end of all our sales documents .  when ever there was an update to the T&C's we would have to slog through each of the sales documents to see which copy of the T&C's it was calling and then do it all over again for the copies in french . Frustrating  as I'm sure you can imagine .

So to get around all that we decided to just have one T&C's document and add it as a second template to the report definitions . that way we only ever need to update one document . but we did have to build in some conditional logic to display the different sections of the T&C's in English and french.  to do that we used Conditional Regions.   these are great you rap a paragraph or a table  or what ever you fancy in some conditional code and it either displays or dosent depending on the logic in the conditional statement the following explains it really well and is shamelessly pilfered from some of the oracle documentation

11.4.5 Inserting and Editing Conditional Regions

A conditional region is an area that is surrounded by a conditional statement. If the statement tests true, the area is displayed in the report; if the condition tests false, the area is suppressed from the report.
For example, your data contains salary and position information for all employees. Your report contains a table that displays the employee, position, and salary. You want your report to display salary information for managers only. Using the insert conditional region functionality, you can select the region that contains the employee table and insert the condition that the position element must equal manager.
To insert a conditional region:

  1. Select the region that you want to apply the condition to. For example, if you want to display a table only for a certain condition, select the region that contains the table. Note that the region must be inside a loop.
  2. From the BI Publisher toolbar select Insert, then Conditional Region.
    The following figure shows the Conditional Region dialog:
    This image is an example of the Conditional Region dialog.
  3. Enter the following fields:
    • Data field - Select the field to test for the condition.
    • Select the data type of the field: Number or Date/Text.
    • Select the comparison operator for the data field. Options are:
      • Equal to
      • Not equal to
      • Greater than
      • Less than
      • Greater than or equal to
      • Less than or equal to
      • Enter the value to define the condition, or select from the list of data elements to define a conditional relationship based on the value of another data element.

No comments:

Post a Comment