Page Total for MultiColumn in Crystal Report

倖福魔咒の 提交于 2019-12-07 01:50:53

问题


I have a multicolumn crystal reports, Now i want to display running total for both weight & amount column's. The image of actual report is this

But crystal report designer does not show other columns, so on which column should i compute the value.


回答1:


Follow this approach:

Create a formula named "RunningTotal" with the following text:

//{@RunningTotal}
WhilePrintingRecords;
Numbervar RunningTotal_Amount;
Numbervar RunningTotal_Weight

Add this formula to the Report Header section (suppress it after you finish testing)

Create another formula named "PageTotal.Reset" with the following text:

//{@PageTotal.Reset}
WhilePrintingRecords;
Numbervar PageTotal_Amount:=0;
Numbervar PageTotal_Weight:=0;

Add this formula to the Page Header section (suppress it after you finish testing)

Create another formula named "PageTotal.Increment" with the following text:

//{@PageTotal.Increment}
WhilePrintingRecords;
Numbervar PageTotal_Amount:=PageTotal_Amount+{TABLE.AMOUNT_FIELD};
Numbervar PageTotal_Weight:=PageTotal_Weight+{TABLE.WEIGHT_FIELD};

Add this formula to the Details section (suppress it after you finish testing)

Create a formula named "PageTotal.Weight.Amount" with the following text:

//{@PageTotal.Amount.Display}
WhilePrintingRecords;
Numbervar PageTotal_Amount;

Add this formula to the Page Footer section. DON'T suppress it, as this will display the page's total.

Create a formula named "PageTotal.Weight.Display" with the following text:

//{@PageTotal.Weight.Display}
WhilePrintingRecords;
Numbervar PageTotal_Weight;

Add this formula to the Page Footer section. DON'T suppress it.

Create a formula named "RunningTotal.Amount.Display" with the following text:

//{@RunningTotal.Amount.Display}
whileprintingrecords;
Numbervar RunningTotal_Amount;
RunningTotal_Amount:=RunningTotal_Amount+{@PageTotal.Amount.Display};

Add this formula to the Page Footer section. DON'T suppress it.

Create a formula named "RunningTotal.Weight.Display" with the following text:

//{@RunningTotal.Weight.Display}
whileprintingrecords;
Numbervar RunningTotal_Weight;
RunningTotal_Weight:=RunningTotal_Weight+{@PageTotal.Weight.Display};

Add this formula to the Page Footer section. DON'T suppress it.

You may need to adapt this approach a little to handle the multi-column display.



来源:https://stackoverflow.com/questions/9111301/page-total-for-multicolumn-in-crystal-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!