Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running total resetting to 0 on a new page

Status
Not open for further replies.

dhv919401

Programmer
Apr 26, 2004
34
CA
I have a crosstab as follows:

SUMMARY FIELD = Operatingdays

year
Quarter
Month
district1 district2 total

unit1 1 2 3
unit2 14 1 15

Total 15 3 18

I created two groups in the report. 1. By month 2. Unit

I added a formula
Sum ({Crystal_SOP_UnitUtilization;1.OperatingDays},{Crystal_SOP_UnitUtilization;1.Unit})

And added this as another summary field in the cross-tab as MAX.

Then I calculated the following values using crurrentfield value function and created a running total of these values for each district using gridrowcolumnvalue like gridrowcolumnvalue = 'district1' then store the sum in a different variable etc...


year
Quarter
Month
district1 district2 total

unit1 1/3 2/3 3/3
unit2 14/15 1/15 15/15

Total 1/3+14/15 2/3+1/15 3/3+15/15

Total 15 3 18

My problem is the running total is set to 0 on every new page.

Any thoughts? I really appreciate your help,


 
I've had that problem, and I think I was able to "anchor" the running total by adding a formula that calls the variable in the main report either in the page header or in the section in which the crosstab is located--can't remember.

-LB
 
One combination that will cause this is to put a reset formula in the Group Header, and then have the GH set to repeat on each page.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I tested this further, and was unable to find a way to prevent a reset of a running total when the page breaks. The only way I could make this work was to place the crosstab in a group that limited the number of rows so that the crosstab always completed within the page. Then I referenced the running total in the crosstab in a formula that I placed in both the page footer and page header:

whileprintingrecords;
numbervar x;

However, this breaks down and the running total resets if any of the groups do not contain an instance of the specific column referenced in the running total gridrowcolumnvalue.

-LB
 
Yes. But I tried resetting the formula in a group header etc.. But because it is not really flexible, I gave up my trials using crosstab in Crystal. I wrote a stored procedure in t-sql and called the procedure through report. This way I found it much easier than fiddling with the Crystal crosstab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top