在RTF模板中对XML标签进行分组,以抑制重复。

问题描述 投票:0回答:1

我的XML标签生成如下----------。

<P_MONTH>01</P_MONTH>


-<G_1>

<DIVISION>CA Division</DIVISION>

<DISTRICT>CA District</DISTRICT>

<DEPARTMENT>Global Operations</DEPARTMENT>

<DEP_EMPL_COUNT>9</DEP_EMPL_COUNT>

</G_1>


-<G_1>

<DIVISION>CA Division</DIVISION>

<DISTRICT>CA District</DISTRICT>

<DEPARTMENT>Laboratory Services</DEPARTMENT>

<DEP_EMPL_COUNT>11</DEP_EMPL_COUNT>

</G_1>


-<G_1>

<DIVISION>CA Division</DIVISION>

<DISTRICT>CA District</DISTRICT>

<DEPARTMENT>Corporate</DEPARTMENT>

<DEP_EMPL_COUNT>3</DEP_EMPL_COUNT>

</G_1>


-<G_1>

<DIVISION>CA Division</DIVISION>

<DISTRICT>S District</DISTRICT>

<DEPARTMENT>Corporate Administration</DEPARTMENT>

<DEP_EMPL_COUNT>6</DEP_EMPL_COUNT>

</G_1>


-<G_1>

<DIVISION>CA Division</DIVISION>

<DISTRICT>S District</DISTRICT>

<DEPARTMENT>Corporate Technology</DEPARTMENT>

<DEP_EMPL_COUNT>1</DEP_EMPL_COUNT>

</G_1>

当我在RTF模板中使用这些标签时,就像下面这样

DIVISION                            DISTRICT                    DEPARTMENT                 COUNT
<?for-each:G_1?> <DIVISION>         <DISTRICT>                   <DEPARTMENT>             <COUNT> <?end for-each?>

这给出了一个类似于-的输出。

DIVISION              DISTRICT                          DEPARTMENT                      COUNT
CA Division           CA District                     Global Operations                  9
CA Division           CA District                     Laboratory Services                11
CA Division           CA District                     Corporate                          3
CA Division           S District                      Corporate Administration           6 
CA Division           S District                      Corporate Technology               1

我希望压制分部和地区的重复值,输出的结果是----------。

DIVISION              DISTRICT                          DEPARTMENT                      COUNT
CA Division           CA District                     Global Operations                  9
                                                      Laboratory Services                11
                                                      Corporate                          3
                      S District                      Corporate Administration           6 
                                                      Corporate Technology               1

如何实现这一点?我无法正确使用for-each-group来对标签进行分组。谁能帮帮我?

xml oracle rtf bi-publisher oracle-xml-publisher
1个回答
0
投票

你也可以使用变量。就像这样。

RTFenter image description here确保你把你的 "if "逻辑放在alt-textfield属性中,否则,它可能无法工作。我把它删掉了,这样你就可以在这里看得更清楚。

輸出enter image description here


0
投票

我会使用嵌套表和for-each-group功能。

RTF。enter image description here

输出enter image description here

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.