Categories
- All Categories
- 4 Oracle Analytics Sharing Center
- 11 Oracle Analytics Lounge
- 190 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.4K Oracle Analytics Forums
- 5.9K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 65 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Need to group duplicate headers into single header on RTF template

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
-
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
Note:
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.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.0