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

Formula subtotals incorrect after a Page Break

Status
Not open for further replies.

rich914

Programmer
Jul 9, 2003
14
US
I have client that I have created some 70 odd reports in Crystal 8.0 Developer edition. This was part of a conversion from several DOS based Clipper systems to a VB 6.0 with an Access 2000 backend database.

I created a system DSN so that crystal could open and read the stored queries that I have in Access.

There two reports that I have not been able to get to work correctly. My group subtotals for the first printed group footer after a page break is incorrect. Other group footers on that page are correct. Does not matter if I run the report from the crystal ide or the VB exe.

The way I have done these reports is all formulas use visual basic syntax. Each report has a formula in the report header section that initializes all global variables (mostly number or currency) and sets them to zero.

I will use one of the two as an example:

3 groups

Group I - call it corporate id - header suppressed
Group II - call it employee id - header suppressed
Group III - call it workday - for each day - header suppressed

Detail section is suppressed - is used to accumulate hours worked by type (28 codes grouped into 5 types)

Group III footer - suppressed - rolls detail totals into another set of totals, zero detail totals, and then accumulates additional totals that are repeated fields for that workday.

Group II footer prints these totals AND uses some of them in other formulas for additional printed information. Totals are rolled into Group I totals and zero group II totals.

This is repeated for Group I footer with the totals being rolled into report totals.

I know that this is probably not the best way to utilize crystal reports, but neither my client nor I could afford to send me to a training class. Do not know about Crystal Decisions, but Seagate's manual (which is the help file) was not very good at explaining anything.

Not sure if this problem is explained enough or not. Will answer any questions the best I can.

Thanks
Richard Barbre
Developer
 
zero detail totals & zero group II totals

I've had trouble in the past getting my formulas that initialize variables to execute at the correct time.

Do you have "Whileprintingrecords;" as the first line in
the formulas that zero out totals?

Another thing I've used is to put "EvaluateAfter(x);" after
the whilerprinting records to make sure the formala for zeroing the totals happens after the total calulation.

Hope this helps!
 
Use the 'WhilePrintingRecords' to accumulate the detail totals and use the 'EvaluateAfter(Group)' for each group footer processing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top