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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running total incorrect value at top of page - CR7

Status
Not open for further replies.

nickos67

IS-IT--Management
May 25, 2001
3
JP
I have noticed this on two reports so far and am puzzled. When i use a running total and it prints at the top of a page it is very occasionally wrong(rare but it happens). This incorrect value then flows through to subtotals and the grand total on the report. It occurs when i preview the report in crystal, or print the final report. However, when i export to excel the value of the running total is correct as are the subsequent totals and grand total.
help please
Many thanks in advance
 
This usually has to do with the settings:

"Keep Group Together"
or
"Repeat Heading on each new page"

Especially in Version 7.

Is the error high or low?
How are you doing the running total, (auto or formula).

Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Hi Ken, there arent any "repeat heading on each new page" but I did take off "keep group together" against one group and this made a difference to the report. I then went into format section and turned off all the "keep together" here as well. This made a further difference to the report. In both cases the onscreen report underestimates the values compared to the excel export.
The running totals are automatic(ie, I am not using a variable which is initialised and accumulates if this is what you are asking) but when i edit the running total, the evaluate - "use a formula" is selected and the formula is a simple {table.field} = integer.
Many thanks again
Nick
 
Nick,

Try to add
______________________
WhilePrintingRecords;
______________________

as the first line in your formula.

If that doesn't work, please provide
us with a more concrete sense of
the expression used in your formula.

Cheers,
- Ido
 
Thanks Ido, I tried whileprintingrecords but this hasn't had any effect. I decided to do away with the automatic running total function in crystal and wrote some formulas to initialise variables and increment them. Guess what? Just when i thought i had it nailed, the problem reappeared.
If the results run onto a second page then the very first row of results will be assigned a zero value and not inlcuded in the totals. The only common denominator appears to be if the results are in the top row of a new page.
Here is how i initialise:

whileprintingrecords;
global numbervar gstforinvoice:=0;

How i increment:

whileprintingrecords;
global numbervar gstforinvoice;
gstforinvoice:=gstforinvoice+{@GSTforLine};

How I print:

whileprintingrecords;
global numbervar gstforinvoice;
gstforinvoice;

There are no "keep together" tickboxes checked anywhere or "repeat heading on new page". The old automatic running totals are still on the report and display properly on the first row of a new page(side by side to my faulty manual running totals).

Thanks for your help and patience
Nick

 
Nick,

Please specify where you placed each formula
and how @GSTforLine is defined.

Also, if the printing formula (let's assume it's
called @Print_me) is placed in the same band as
the incrementing formuala (let's assume it's
called @Increment_me), try to add
-------------------------------
EvaluateAfter({@Increment_me})
-------------------------------
as the first line in @Print_me

Cheers,
- Ido




 
Are you initializing this variable in the page header by any chance? That will cause this behavior.

If the initialize is in the group header, then double check your group options to confirm that it is not set to repeat the group header as a page header. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top