I would like to generate a report using RTF Template which looks like the below:
Expected Output:
US
Cover Insured
123456 INS1, INSB, INSA
987654 INS2
or
US
Cover Insured
123456 INS1
INSB
INSA
987654 INS2
Here "Insured" data is present both in Parent and child hierarchy with different tag names. Parent "InsuredAccnt" (INS1 in my XML) should be displayed first followed by child "InsuredAccounts" which will be sorted by "Share" - Descending.
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<InsuredReport>
<GroupPolicies>
<Cover>123456</Cover>
<Customer>Customer</Customer>
<InsuredAccnt>INS1</InsuredAccnt>
<Organization>US</Organization>
<ListOfGroupPolicies_InsuredAccount>
<GroupPolicies_InsuredAccount>
<InsuredAccount>INSA</InsuredAccount>
<Share>5</Share>
</GroupPolicies_InsuredAccount>
<GroupPolicies_InsuredAccount>
<InsuredAccount>INSB</InsuredAccount>
<Share>20</Share>
</GroupPolicies_InsuredAccount>
</ListOfGroupPolicies_InsuredAccount>
</GroupPolicies>
<GroupPolicies>
<Cover>987654</Cover>
<Customer>ABC</Customer>
<InsuredAccnt>INS2</InsuredAccnt>
<Organization>US</Organization>
<ListOfGroupPolicies_InsuredAccount />
</GroupPolicies>
</InsuredReport>
I am not sure how to upload the RTF used, but this is a gist of the same:
RTF:
<?for-each-group:GroupPolicies;./Organization?>
Grouping within Table based on Cover
<?for-each-group:current-group();./Cover?>
Displaying "Insured"
<?InsuredAccnt?>
<?for-each-group:current-group();./GroupPolicies_InsuredAccount?><?sort: Share?><?InsuredAccount?><?end for-each-group?>
When I give this, my system runs forever and I am forced to kill the session. Please could someone point out where I am wrong.