0

我生成的 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 对标签进行分组。有人可以帮忙吗?

4

2 回答 2

0

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

RTF: 在此处输入图像描述

输出 在此处输入图像描述

于 2020-05-29T16:40:51.590 回答
0

您也可以使用变量。像这样的东西:

RTF 在此处输入图像描述 确保将“if”逻辑放在 alt-text/field 属性中,否则它可能不起作用。我把它拿出来让你在这里看得更清楚。

输出 在此处输入图像描述

于 2020-06-02T22:50:35.357 回答