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

values repeat from last line of one page to first line of next page

Status
Not open for further replies.

SteveBell

Technical User
Mar 23, 2001
40
US
My report uses a combination of sums, running totals, and formulas in a group footer. When I suppress or hide the details section, the values from the bottom line of each page are duplicated in the first line of the next page (replacing the correct values). When I unhide or unsuppress the details section, the values are correct.

Any suggestions where I should start looking?
 
What version?
Running total formulas or Running Total Fields?

I would look in the Change Group Expert at the settings "Keep Group Together" and "Repeat Group Header on each new page". These can cause some variables to be incremented incorrectly. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I have also recently encountered this problem with someone who is using V7 of Crystal. There is a patch file available from Seagate to fix the same problem with shared variables, I suspect that this problem is related. If you are on V7 and have not installed the patch, it should be done. I could not install the patch on this users system because it was an OEM modified version of Crystal and rejected the patch. I created manual running totals as a work around for this user. Jim Varco
Varco Consulting
jimvarco@att.net
 
Running Total fields are problematic in a number of areas. In fact, they are only accurate in the Detail Section, Group Footers and Report Footer.

In the "How Running Totals Work" of the Crystal Reports 8.5 Help file, you will find the following warning about the placement of Running Total fields:

Placement of running total fields
The calculation of a Running Total field is determined by the settings selected in the Running Total Expert. However, where you place the running total affects the value that appears on the report. For example, if a Running Total field that evaluates every record and never resets (a grand total) in the Report Header, only the value of the first record will appear. Placing the same Running Total field in the Report Footer returns the desired value. The Running Total field is properly calculated in both cases, but it is displayed too soon in the first case.

The following is a list of the report sections and the records that the running total will use.

Report Header
Returns first record of the report

Page Header
Creates running total up to and including the first record of current page.

Group Header
Creates running total up to and including first record of current group.

Details
Creates running total for every record.

Group Footer
Creates a grand total for each group.

Page Footer
Creates running total up to and including the first record of the next page.

Report Footer
Creates a grand total that includes all records


That's why, despite the fact that they are much more work, I prefer to use Variables instead of Running Total fields.

HTH,
John Marrett
Crystal Reports & Crystal Enterprise Trainer
 
Running total fields in V7 have an actual Bug that I have experienced that has to do with repeated group headers and keep togethers throwing off the accumulations under certain conditions. This was fixed in V8 unless I am mistaken.

What John is describing is not a bug, but the expected behavior of a running total. I am a bit puzzled by John's post, because if you use variables under the same conditions (the accumulate formula on the detail band and the display formula in the various sections mentioned) I think you would give the exact same results.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Some comments / clarifications:

1. I'm not sure if they ever fixed that 'Keep group together' bug. I haven't checked it recently... In the release notes of version 7 MR 1, we were told that the bug was fixed. I went ahead and used Running Total Fields in a very complex report for a client. In testing, I discovered that the bug was actually NOT fixed. Due to client criteria, turning off 'Keep group together' was not an option for this particular report so I had to redo all of the Running Total Fields (and there were many!) using variables. Variables were never affected by the 'Keep group together' bug. So I was able to fix the report.

2. I find that I have more control with variables.

Happy New Year to all!
John Marrett
Crystal Reports & Crystal Enterprise Trainer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top