获取水晶报表中每页字段的总和 [英] Get sum of a field per page in crystal report

查看:28
本文介绍了获取水晶报表中每页字段的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水晶报表并得到这样一个字段的总和:

I Have a Crystal Report and get the sum of a field like this:

Sum({TheField})

我把它放在 PageFooter 部分以在所有页面中都有它,但如果报告有多个页面,它会显示所有字段的总和,我需要获取每页的总和.

and I put it in PageFooter section to have it in all pages but if the report has multiple pages it shows the sum of all fields and I need to get the sum per page.

有什么想法吗?

推荐答案

您可以按如下方式获取页面级别总计.在报表设计中创建三个公式字段,分别是ff_Reset_Totalff_Current_Totalff_Add_Record,并在公式编辑器中设置它们的值如下:

You can get page level totals as follows. Create three formula fields in report design, namely ff_Reset_Total, ff_Current_Total, ff_Add_Record and set their values in formula editor as under:

  1. ff_Reset_Total

  1. ff_Reset_Total

whileprintingrecords;
numbervar PageTotl;
PageTotl:=0;

  • ff_Current_Total

  • ff_Current_Total

    whileprintingrecords;
    numbervar PageTotl;
    PageTotl;
    

  • ff_Add_Record

  • ff_Add_Record

    whileprintingrecords;
    numbervar PageTotl;
    PageTotl:=PageTotl + {TheField};
    

  • 现在将这些公式字段放入您的报告中,如下所示:

    Now place these formula fields in your report as under:

      页眉部分中的
    1. ff_Reset_Total
    2. 页脚部分中的
    3. ff_Current_Total
    4. ff_Add_Record 在您的详细信息部分
    1. ff_Reset_Total in Page Header Section
    2. ff_Current_Total in Page Footer Section
    3. ff_Add_Record in your Details Section

    现在隐藏 ff_Reset_Totalff_Add_RecordPage Header 中通过 Right Click 每一个详细信息 部分,指向 Format Field,然后在 Common 选项卡中选择 Suppress

    Now hide ff_Reset_Total and ff_Add_Record by Right Click on each of them in Page Header and Details Sections, point to Format Field and then in the Common tab select Suppress

    这篇关于获取水晶报表中每页字段的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆