This discussion is archived
6 Replies Latest reply: Mar 6, 2013 6:50 AM by w2vijay RSS

Sections on Same Hierarchy, Regroup the data

w2vijay Newbie
Currently Being Moderated
Below is the structure of XML data with Account_header,Print_Report and Account_totals on the same hierarchy.

<Account_Header_S8>
<AcctNoInputMode_ID7>200.1201</AcctNoInputMode_ID7>
<AccountId_ID9>00010276</AccountId_ID9>
</Account_Header_S8>
<Print_Report_2_S6>
<Detail_Amount_ID18>-8344187.76
</Print_Report_2_S6>
<Account_Totals_S7>
<TotalDetailAmount_ID2>-8344187.76</TotalDetailAmount_ID2>
<TotalF0902Amount_ID4>-8114589.76</TotalF0902Amount_ID4>
<TotalDifferenceAmount_ID6>
</Account_Totals_S7>
<Print_Report_2_S6>
<Detail_Amount_ID18>-8344187.76
</Print_Report_2_S6>
<Account_Totals_S7>
<TotalDetailAmount_ID2>-8344187.76</TotalDetailAmount_ID2>
<TotalF0902Amount_ID4>-8114589.76</TotalF0902Amount_ID4>
<TotalDifferenceAmount_ID6>
</Account_Totals_S7>
<Account_Header_S8>
<AcctNoInputMode_ID7>200.1201</AcctNoInputMode_ID7>
<AccountId_ID9>00010276</AccountId_ID9>
</Account_Header_S8>
<Print_Report_2_S6>
<Detail_Amount_ID18>-8344187.76
</Print_Report_2_S6>
<Account_Totals_S7>
<TotalDetailAmount_ID2>-8344187.76</TotalDetailAmount_ID2>
<TotalF0902Amount_ID4>-8114589.76</TotalF0902Amount_ID4>
<TotalDifferenceAmount_ID6>
</Account_Totals_S7>
<Print_Report_2_S6>
<Detail_Amount_ID18>-8344187.76
</Print_Report_2_S6>
<Account_Totals_S7>
<TotalDetailAmount_ID2>-8344187.76</TotalDetailAmount_ID2>
<TotalF0902Amount_ID4>-8114589.76</TotalF0902Amount_ID4>
<TotalDifferenceAmount_ID6>
</Account_Totals_S7>

The data should be looped first on Account_header then print_Report,Acount_Totals for each account_Header. Should be like below.

Account Header1
Print_Report
Account_Total
Print_Report
Account_total
Account Header2
Print_Report
Account_Total
Print_Report
Account_Total

Thanks in advance.
  • 1. Re: Sections on Same Hierarchy, Regroup the data
    w2vijay Newbie
    Currently Being Moderated
    Guys,

    Any solution for the above scenario.

    Thanks,
    Vijay Vattiprolu
  • 2. Re: Sections on Same Hierarchy, Regroup the data
    AlexAnd Guru
    Currently Being Moderated
    first of all xml isn't correct

    is it dynamic structure xml or for one Account_Header_S8 you have exactly two Print_Report_2_S6 and Account_Totals_S7 ?
    for static structure you can try to use position like "Account_Header_S8[1]"
    for dynamic structure IMHO it's not possible or i may be wrong

    another way you can try is to transform xml structure
    - in program which generate xml
    - by xslt
  • 3. Re: Sections on Same Hierarchy, Regroup the data
    w2vijay Newbie
    Currently Being Moderated
    Alex - Thanks for the reply.

    I just verified XML file after seeing your question of number of Print_Report sections.

    The XML file begins with Account_Header_s8 and then 8 Print_Report, then 8 Account_Totals again Account_Header like this till the end of file. The number of Print_Report can vary some times 4 or 1, but the Account_Totals sections will be same number as Print_Report. Hope I explained it better now. The XML file is generated from JDE Report dynamically. Below is the example.

    Account_Header_s8
    Print_Report
    Account_Totals
    Print_Report
    Account_Totals
    Print_Report
    Account_Totals

    Account_Header_s8
    Print_Report
    Account_Totals
    Print_Report
    Account_Totals

    Account_Header_s8
    Print_Report
    Account_Totals

    Thanks,
    Vijay Vattiprolu
  • 4. Re: Sections on Same Hierarchy, Regroup the data
    AlexAnd Guru
    Currently Being Moderated
    >
    The XML file is generated from JDE Report dynamically.
    >
    can you change logic of forming xml?


    you can try xslt http://docs.oracle.com/cd/E23549_01/bi.1111/e13881/T527073T558978.htm
    as idea
    - change parent tag Account_Header_S8, Print_Report_2_S6, Account_Totals_S7 to be the same as "parentnode"
    - change all child nodes as nodes1, nodes2, nodes3

    then you can use for-each as is
    and it print sequentially as in xml with xslt
  • 5. Re: Sections on Same Hierarchy, Regroup the data
    w2vijay Newbie
    Currently Being Moderated
    yes - We can change the JDE report to form the required XML structure. But this will become habit to change the JDE report every time. Idea is to get the required output as I mentioned with existing xml structure.

    I can send you the xml and rtf template files .

    Thanks,
    Vijay Vattiprolu.
  • 6. Re: Sections on Same Hierarchy, Regroup the data
    w2vijay Newbie
    Currently Being Moderated
    Guys,

    Any solution for this scenario?.

    Thanks,
    Vijay Vattiprolu

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points