A document may contain different type of grouping such as:
- header level information,
- and contacts.
This group may be:
- present in the XML document as data source.
- of created or redesign at run time.
A data set is a group of data.
A document can contain:
- multiple data set (from an XML document of from multiple data source)
- whereas a database return a document with a single data set. In this last case, we say that the data set is flat.
<INVOICELIST> <G_VENDOR_NAME> <VENDOR_NAME>Nuts and Bolts Limited</VENDOR_NAME> <ADDRESS>1 El Camino Real, Redwood City, CA 94065</ADDRESS> <G_INVOICE_NUM> <SET_OF_BOOKS_ID>124</SET_OF_BOOKS_ID> <GL_DATE>10-NOV-07</GL_DATE> <NVL_I_DISCOUNT_AMOUNT_TAKEN_0>0</NVL_I_DISCOUNT_AMOUNT_TAKEN_0> <INV_TYPE>Standard</INV_TYPE> <INVOICE_NUM>981110</INVOICE_NUM> <INVOICE_DATE>10-NOV-07</INVOICE_DATE> <INVOICE_CURRENCY_CODE>EUR</INVOICE_CURRENCY_CODE> <ENT_AMT>122</ENT_AMT> <ACCTD_AMT>122</ACCTD_AMT> <VAT_CODE>VAT22%</VAT_CODE> </G_INVOICE_NUM> <G_INVOICE_NUM> <SET_OF_BOOKS_ID>124</SET_OF_BOOKS_ID> <GL_DATE>28-MAY-07</GL_DATE> <NVL_I_DISCOUNT_AMOUNT_TAKEN_0>.41</NVL_I_DISCOUNT_AMOUNT_TAKEN_0> <INV_TYPE>Standard</INV_TYPE> <INVOICE_NUM>100000</INVOICE_NUM> <INVOICE_DATE>28-MAY-07</INVOICE_DATE> <INVOICE_CURRENCY_CODE>FIM</INVOICE_CURRENCY_CODE> <ENT_AMT>122</ENT_AMT> <ACCTD_AMT>20.33</ACCTD_AMT> <VAT_CODE>VAT22%</VAT_CODE> </G_INVOICE_NUM> </G_VENDOR_NAME> <G_VENDOR_NAME> ................. </G_VENDOR_NAME> </INVOICELIST>
From a database, you can create a data source with multiple data set with the data template functionality to be able to create for instance a multiple master detail report.
A repeating section (as a table) is a design group created with:
- Word form fields
- and (for-each) processing instructions.
To create section, the Template Builder can generate the following for-each instructions:
- for-each For a multiple data set source
- for-each-group: For a single data set source or to change grouping at runtime
Word form fields properties:
- the For-each section allows you to select a data set. If the data set is flat, you will get only one repeatable element. In cases with multiple data sources or hierarchical XML you can choose the data set.
- the group drop box allow you to create for-each-group instruction.
For a group element in the XML Hierarchy File
<?for-each:XML group element tag name?> My Section <?end for-each?>
The RTF template supports the XSL 2.0 for-each-group standard that allows to regroup XML data into hierarchies that are not present in the original data.
<?for-each-group:ROW;./YEAR?> <?sort:YEAR?> <?YEAR?> <?for-each-group:current-group();./MONTH?> <?for-each:current-group()?> <?INDUSTRY?> <?SALES?> <?end for-each?> <?end for-each-group?> <?end for-each-group?>
At runtime, you can see the group in the fo file from the diagnostic log of from the export options of the BI Desktop tool.
If you are creating nested groups (inserting a loop or group inside of another loop in the template), the For Each field is not updateable because it is already defined by the preexisting outer loop. The For Each field will display “Group Item” to inform you that an outer group is already defined.
Selecting a group by element will actually regroup the data into a new hierarchy based on the group by element.
The function, ‘for-each-group’ permit to regroup the data at runtime. The group created then cannot be referred on design time.
Before selecting the Repeating Group functionality, you have to select the block of text that you want to repeat.