在水晶报告中获取每页的字段总和 [英] Get sum of a field per page in crystal report
问题描述
我有一个水晶报表,并获得如下字段的总和:
Sum({TheField})
,我把它放在PageFooter部分在所有页面中都有,但如果报告有多个页面,
任何想法如何实现?
您可以按如下方式获取页面级别总计。在报表设计中创建三个公式字段,即 ff_Reset_Total
, ff_Current_Total
, ff_Add_Record
并在公式编辑器中将其值设置为:
-
ff_Reset_Total
$ b bwhileprintingrecords;
numbervar PageTotl;
PageTotl:= 0;
-
ff_Current_Total
whileprintingrecords;
numbervar PageTotl;
PageTotl;
-
ff_Add_Record
whileprintingrecords;
numbervar PageTotl;
PageTotl:= PageTotl + {TheField};
现在将这些公式字段 部分
$ b
-
ff_Reset_Total
/ li>
-
ff_Current_Total
在页脚部分 -
ff_Add_Record
ff_Reset_Total
whileprintingrecords; numbervar PageTotl; PageTotl:=0;
ff_Current_Total
whileprintingrecords; numbervar PageTotl; PageTotl;
ff_Add_Record
whileprintingrecords; numbervar PageTotl; PageTotl:=PageTotl + {TheField};
ff_Reset_Total
in Page Header Sectionff_Current_Total
in Page Footer Sectionff_Add_Record
in your Details Section
现在隐藏
ff_Reset_Total
和 ff_Add_Record
由右键单击
标题和细节部分,指向格式字段
,然后在 Common
标签选择抑制
I Have a Crystal Report and get the sum of a field like this:
Sum({TheField})
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.
Any ideas how to do that?
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:
Now place these formula fields in your report as under:
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屋!