本文介绍了Crystal Report 中多列的总页数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多列水晶报表,现在我想显示体重和体重的总和.金额列的.实际报告的图片是这个

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.

推荐答案

按照这个方法:

使用以下文本创建一个名为RunningTotal"的公式:

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)

使用以下文本创建另一个名为PageTotal.Reset"的公式:

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)

使用以下文本创建另一个名为PageTotal.Increment"的公式:

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)

使用以下文本创建一个名为PageTotal.Weight.Amount"的公式:

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.

使用以下文本创建一个名为PageTotal.Weight.Display"的公式:

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.

使用以下文本创建一个名为RunningTotal.Amount.Display"的公式:

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.

使用以下文本创建一个名为RunningTotal.Weight.Display"的公式:

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.

这篇关于Crystal Report 中多列的总页数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 17:10