Total Pages for Multiple Columns in a Crystal Report

I have a multi-column crystal report. Now I want to display the current total amount for both the weight and the sum column. The image of the actual report is

enter image description here

But the designer of the Crystal report does not show other columns, so on which column should I calculate the value.

+6
source share
1 answer

Follow this approach:

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

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

Add this formula to the header section of the report (suppress it after testing is complete)

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 title section (suppress it after testing is complete)

Create another formula called "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 testing is complete)

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

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

Add this formula to the page footer section. DO NOT suppress it, as this displays a shared page.

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

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

Add this formula to the page footer section. DO NOT suppress it.

Create a formula called "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. DO NOT suppress it.

Create a formula called "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. DO NOT suppress it.

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

+2
source

Source: https://habr.com/ru/post/907477/


All Articles