Click to See Complete Forum and Search --> : Total problem in crystal report


sudhin
November 22nd, 2004, 05:40 AM
Hello Mr.Babu,
i am new in this code guru.i need a help from your side.i am working in crystal report with vb as frount end. now the problem i am facing is that i need the total of all the sum in the end of the page.but the thing is that the salary report come in the case of month.some time one months half will be first page and the second half will be next page so when the total is added the sum of the half which is gone into the next page also comes in the first page .what can we do for that.if it is a single month continous for two pages then no problem.we are dealing with salary problem.so we have to take for more than tow months in the report.if the month ends in one page it self then there is no problem.

the second problem is that for each name there will be four columns .in some case at the last of the page there will be space for three columns so one column goes to next page .how we control this ie if there is no space for four columns then the whole shold come in the next page.

springsoft
November 22nd, 2004, 04:47 PM
Insert RunningTotal field(s) into the page footer, based on the fields that appear in the Details section.
Right Click on the field, then select Insert... , then Running Total.
You have to name the RunningTotal, select the field its based on, determine when summing occurs etc, but once you've done one it becomes quite straighforward.

Do a search for RunningTotal on this thread, or go to:
http://support.businessobjects.com/library/kbase/articles/c2006365.asp

this link gives a Crystal 8 example.

Dave

erickwidya
November 22nd, 2004, 09:04 PM
...i need the total of all the sum in the end of the page. yes it can be doned..ur problem seems similar to mine :)
this what i get..

Restrict number of detail lines
In the Format Section -> Details -> New Page Before - add this formula : RecordNumber Mod 20 = 0

Page by Page totals
You need to use a global variable and 3 formulas. One formula resets the global variable to 0, another sums the amount and still another is used to display the variable. Each Formula must have the exact same declaration for the Global variable. Obviously change CurrencyVar to your data type.

Create the following formula, I call it PageTotalReset, and place it in the Page Header section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue := 0;

Create the following formula, I call it PageTotalAmount, and place it in the Details section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue := PageTotalValue + {TableName.FieldName};

Create the following formula, I call it PageTotalDisplay, and place it in the Page Footer section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue;

...if there is no space for four columns then the whole shold come in the next page u have to put a formula at New Page Before at ur related section (i assume at Detail section)
that u put maybe this code..
tablename.colums4 = "" and see what happened..

hope this can help

Madhi
November 24th, 2004, 12:27 AM
erickwidya's idea seems to work well for page wise totals.Thanks. Also we can suppress PageTotalReset formula field.

Madhivanan

erickwidya
November 24th, 2004, 08:48 PM
ur welcome Madhi..
yes it works for me..hope it works for others too

Lerkhern
July 13th, 2005, 06:23 PM
AWESOME!
Just what I was looking for! Thank you!!!!!