Here I am going to explain how grouping XML Data in RTF Template works. Allow's generate a uncomplicated study with SQL data source using SH schema. We tin handle grouping and aggregation at the SQL level, but sometimes we take a requirement to use this as an RTF Template.

Step 1: Creating Data Model

Here is the SQL using 3 tables to become required columns for the report:

BI-Publisher-Grouping-and-Aggregation-0

BI-Publisher-Grouping-and-Aggregation-1

BI-Publisher-Grouping-and-Aggregation-2

BI-Publisher-Grouping-and-Aggregation-3

BI-Publisher-Grouping-and-Aggregation-4

Creation of information model part is done. Save the data mode with Group_DM name and generate XML.

(Article continued afterwards pause)

Keep Moving Forward with Aptude

Aptude is your ain personal Information technology professional services firm. We provide our clients with offset class resource in a continuous, toll-containment fashion.

Our support services will free up your senior IT staff from the overwhelming burden of mean solar day-to-24-hour interval maintenance problems. Now they'll have fourth dimension to launch those new projects and applications you've been waiting for.Simply put, we tin can gratuitous up your resources and contain your costs. Permit'southward have a quick chat to talk over our exclusive services.

(Continued)

Export XML to build RTF Template.

BI-Publisher-Grouping-and-Aggregation-5

BI-Publisher-Grouping-and-Aggregation-6

Sample XML that was generated. It is the flat XMLwhich has no aggregations and group.

< DATA_DS >

< G_1 >

< CUST_FIRST_NAME > Anne </ CUST_FIRST_NAME >

< CUST_LAST_NAME > Koch </ CUST_LAST_NAME >

< COUNTRY_REGION > Europe </ COUNTRY_REGION >

< COUNTRY_SUBREGION > Western Europe </ COUNTRY_SUBREGION >

< COUNTRY_NAME > Spain </ COUNTRY_NAME >

< AMOUNT_SOLD > 1232.16 </ AMOUNT_SOLD >

</ G_1 >

< CUST_FIRST_NAME > Anne </ CUST_FIRST_NAME >

< CUST_LAST_NAME > Koch </ CUST_LAST_NAME >

< COUNTRY_REGION > Europe </ COUNTRY_REGION >

< COUNTRY_SUBREGION > Western Europe </ COUNTRY_SUBREGION >

< COUNTRY_NAME > Spain </ COUNTRY_NAME >

< AMOUNT_SOLD > 1550.99 </ AMOUNT_SOLD >

</ G_1 >

</ DATA_DS >

Stride 2: Build RTF Template

Open new word document and load xml data using template architect.

BI-Publisher-Grouping-and-Aggregation-7

We inserted all fields without making any formatting.

BI-Publisher-Grouping-and-Aggregation-8

Output:

BI-Publisher-Grouping-and-Aggregation-9

Let's practice some formatting and group to brandish like this:

Country Region        Total Corporeality
Country Sub Region    Total Amount
Country Name        Total Amount
Customer Full Name        Full Corporeality

We have to summate totals for all the individual customers, Land wise, Country sub region wise and state region wise. To reach this nosotros have to grouping the XML information and employ assemblage functions in the RTF Template.

In the RTF Template placeholders should exist placed where ever required. From the XML information place the tag which we need to group. In this case we accept four groups:

ane. Country Region
two. Country Sub Region
3. Country Proper name
4. Customers

Based on these groups we have to apply aggregation rule on Amount Sold.

BI-Publisher-Grouping-and-Aggregation-10

Lawmaking behind placeholders:

BI-Publisher-Grouping-and-Aggregation-11

Output:

BI-Publisher-Grouping-and-Aggregation-12

What Are You Working On?

Looking for intelligent technological solutions? Seeking consultation on your upcoming projects? Need a quote for services? Contact Aptude'due south executive team straight. Information technology's amazing only how much one little electronic mail tin rapidly accelerate your productivity.

Keep Moving Forrad with Aptude

Aptude is your ain personal It professional person services house. We provide our clients with outset class resources in a continuous, price-containment mode.

Our support services volition free upwardly your senior IT staff from the overwhelming burden of day-to-24-hour interval maintenance problems. Now they'll have fourth dimension to launch those new projects and applications you lot've been waiting for. Simply put, we can free upwards your resources and contain your costs. Let's have a quick conversation to discuss our sectional services.