Print Page | Close Window

Running Totals

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22596
Printed Date: 25 Apr 2024 at 4:39am


Topic: Running Totals
Posted By: Mohan56
Subject: Running Totals
Date Posted: 10 May 2018 at 12:51pm
Would you know why my 5YearTotal column displays the total value on the next row, instead of the current?

I have the following formula in my Detail Section;

whileprintingrecords;
Global numbervar RunningSalesTotal5YR;
Global numbervar RunningSalesTotalParmDates;
Global datetimevar StartBillDatePlus5Yrs;


If ({#RunningTotal} > 9999) and ({Bill_Date} <= StartBillDatePlus5Yrs) then RunningSalesTotal5YR := {#RunningTotal};

My results show up as following;

TotalBilled     RunningTotal     5YearTotal
479.60          9,592.00          0.00
719.40          10,311.40        0.00
479.60          10,791.00        10,311,40
119.90          10,910.90        10,791.00
119.90          11,030.80        10,910.90



Replies:
Posted By: DBlank
Date Posted: 14 May 2018 at 8:12am
I believe that the whileprintingrecords and Running Totals both execute in Pass 2. The RT should execute just before the PrintTime formulas.
Do you have more than one detail section? items in Detail a will run before detail b.



Print Page | Close Window