First step to develop a good RTF template is to develop a good data model. When i say good data model, it means be crystal clear in the relationship of the various fields to be displayed in the report e.g. parent- child relationship, fields which will determine the behavior of the template e.g. hiding certain sections of the report at the run time.
My experience says that at least 80% reports will be simple tabular report or report with a header and children e.g PO print report with PO header data in top section of the report and Line information in lower section.
For sake of simplicity ( to be true: to avoid the data breach & keep it simple), i created an XML like below:
Alright, very basic operation we must be able to do in any type of coding is to do the looping. Again, there can be at least 2 types of looping. First to loop through based on the data ( XML in this case). Or to loop through it finite number of times. Lets see the syntax of the data based looping:
Syntax:
<?for-each:G_1?> Your text here…<?end for-each?>
if you look closely at the XML and the code syntax here, the top most node name is G_1. So this code snippet loops through all the records in G_1 node. So if the code looks like below:
This is how output will be:
And if the output needs to be printed for both PO header and PO Line, a sample code can look like this:
Corresponding output will be:
Look closely at the code and see how the looping is done for parent- child records. And corresponding output. Now take a closer look at output. You will see that output is spanned through 2 pages. well, trick lies in command: <?split-by-page-break:?>
Related Posts:
RTF Template- Looping Finite Number Of Times
RTF Number Formatting With Examples
RTF Date Formatting With Example
OTBI Report Creation in Oracle Fusion
Feedback:
Hope the article helped you. If it did, please rate the post. In case it didn’t, do leave a comment to let us know what did we miss.
Reference:
support.oracle.com