This worksvery well but you should note that you are now performing calculations in themiddle tier which is not as performant as in the database. You should performas much of your business processing in the database as possible. You also notice that we can give somecontext to the total by adding another form field to contain the supplier name,, as we are in the invoices level we can simply referencethe parent vendor name value for the supplier.
可以对多个字段进行合计,由于页合计在XML数据中是不存在的,所以需要定义一个变量,定义变量的同时将计算的字段关联起来了 TotalFieldName:合计值对应的字段 ?element?:被合计的XML元素名称
十九. 显示页合计
TotalFieldName:合计值对应的字段 number-format:合计值显示的格式 例子:
二十.结转合计
某些报表要求将页的合计显示在页尾和下一页的页头,这种合计叫做结转合计。下面是结 转合计的例子:
在第一页的尾部显示了页的合计;在第二页的顶部结转显示了第一页的合计,依次类推
需要在页码的顶部实现结转合计,只要在每页的(除了第一页)顶部使用如下的语句: Invoice Listing Report 1000 1000 Page Total: 1000 1000 1000 1000 Init PTs Invoice Type Invoice Invoice Number Date Invoice Entered Amount Accounted Currency Amount 1,000.00 1,000.00 EG FEINV_TYPE 132342 10-May-07 USD End PTs 二十一. 连续合计(同参数高级应用) 报表实现如下的累积合计值 1. 定义变量 2. 添加每行值 3. 显示累积合计值 xdoxslt:get_variable($_XDOCTX, ’VariableName’)?> xdoxslt:get_variable($_XDOCTX, ’RTotalVar’)?> 二十二. 排序 可以使用组中的字段对组进行排序,在组标记内插入如下的命令标记: 也可以对组中的多个字段进行排序: …… 二十三. 对XML数据从新分组 Youmay need to further group your data in addition to the existing grouping, inthis case we have: SUPPLIERS INVOICES Ratherthan update the XML extraction, we can actually introduce a new group to thehierarchy in the template layer so we have: SUPPLIERS CURRENCY INVOICES Wecan use a new function, ?for-each-group? to effectively regroup the data in thetemplate to show the invoices by currency code, we can then show summary totalsat the current level too. In the template below you notice that it has beenrestructured from the previous version. There is now a new table: TheReGrp:Curr field has the following: for-each-group:G_INVOICE_NUM;INVOICE_CURRENCY_CODE Thisis specifying that we want to create a new group ?INVOICE_CURRENCY_CODE? based onthe original ?G_INVOICE_NUM? group.We then have the currency label/value pair, the invoice table then follows,inside the Grp:Invoice field we now have ?for-each:current-group()? torefer to the new INVOICE_CURRENCY_CODE group we have just created. Note: wecannot refer to the group as INVOICE_CURRENCY_CODE as this group is onlycreated at runtime. Sonow we have a new grouping we can create summary totals at this level togenerate totals per currency, inside the new fields we havesum (current-group()/ENT_AMT) for the enteredamount, again we use the current-group() tag to refer to the new ?INVOICE_CURRENCY_CODE? group. I Grp:SupplierDecimal Format Supplier Supplier 1 Address 1 Long Avenue ReGrp:Curr Currency: USD Invoice Number Grp:Invoice1134922 Type Standard Invoice Date GL Date En01-Jan-2007 01-Jan-2007 Total for USD End Curr 结果:多加了个分组Currency 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库BI Publisher(rtf)模板开发语法大全(3)在线全文阅读。
相关推荐: