6

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

enter image description here

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

manav inder
  • 3,531
  • 16
  • 45
  • 62
  • Doesn't it work with first set of columns already? You have to place totals into group footer and make group footers multicolumn too - page footer can't be multicolumn IMO. – Arvo Feb 02 '12 at 11:40
  • You are right, page footer can't be multicolumn. But i am not using groups, so there is no group footer in here – manav inder Feb 02 '12 at 11:45
  • @MSingh Why you can't add multiple values in Page Footer? I am already using multiple columns in Page Footer. – RKh Feb 02 '12 at 11:55
  • How are you using Multiple columns in Page Footer, When i select page footer and go to Section Expert, "Format Data with Multiple Columns" checkbox is not available, Kindly verify – manav inder Feb 02 '12 at 12:32
  • @MSingh, please post a picture of your report with *just* the columns that you want to summarize. The current picture is confusing. – craig Feb 05 '12 at 18:51
  • @MSingh: Does the picture show the **current** layout of the report, or the **desired** layout? –  Feb 07 '12 at 08:10
  • @MSingh, so the running totals are in the page footer? one total for the page and another that adds the current page's value to all of the prior pages' values? – craig Feb 09 '12 at 21:03

1 Answers1

2

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.

craig
  • 25,664
  • 27
  • 119
  • 205