我生成的 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>
<INTERNAL_ADDRESS_LINE>100-01-000-000-210-99802-000-000000-000000</INTERNAL_ADDRESS_LINE>
<DEP_EMPL_COUNT>6</DEP_EMPL_COUNT>
<SERVICE_LINE>000</SERVICE_LINE>
</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
但我希望在输出中进行分组,并根据分区和分区的分组计算总数。我为此使用了嵌套表。有点像——