Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Need to group duplicate headers into single header on RTF template

Received Response
11
Views
1
Comments

This is for Commercial Invoice report and the XML is something like this:

<G_HEADER>

some info: X1

<G_UOM>

Pounds

<G_LINES>

some info

</G_LINES>

</G_UOM>

</G_HEADER>

<G_HEADER>

some info: X1

<G_UOM>

Each

<G_LINES>

some info

</G_LINES>

</G_UOM>

</G_HEADER>

The header info is exactly the same but populating in 2 separate headers. I cannot touch the Data model. Is tehre a way to group them into a single header on the RTF Template?

Any direction is highly appreciated!

Answers

  • Rank 6 - Analytics Lead

    Hi Sneha,

    You can group duplicate headers into a single header in your RTF template using BI Publisher’s for-each-group function. Since you cannot modify the data model, the best approach is to group the headers based on the common field (some info: X1).

    Solution: Using for-each-group in RTF Template
    Modify your RTF template to group headers by the common field (some info: X1):

    xml

    <?for-each-group:G_HEADER;some info?><?end for-each-group?>
    <G_HEADER>
    <?some info?>
    <?for-each:G_UOM?>
    <G_UOM>
    <?UOM?>
    <?for-each:G_LINES?>
    <G_LINES>
    <?LINES?>
    </G_LINES>
    <?end for-each?>
    </G_UOM>
    <?end for-each?>
    </G_HEADER>
    <?end for-each-group?>

    Explanation
    1. for-each-group:G_HEADER;some info → Groups headers by the common field (some info).
    2. Inside the grouped header, for-each:G_UOM ensures UOM values are listed under the same header instead of separate headers.
    3. for-each:G_LINES ensures line details remain intact within each UOM.

    Note:

    If formatting issues arise, ensure that table structures in the RTF template align properly.
    If the grouping does not work as expected, try using distinct values or sorting within the for-each-group function.

Welcome!

It looks like you're new here. Sign in or register to get started.