Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 43 Oracle Analytics and AI Sharing Center
- 19 Oracle Analytics and AI Lounge
- 283 Oracle Analytics and AI News
- 59 Oracle Analytics and AI Videos
- 16.3K Oracle Analytics and AI Forums
- 6.4K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 108 Oracle Analytics and AI Trainings
- 20 Oracle Analytics and AI 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
