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

Shared Variable shows wrong data 1

Status
Not open for further replies.

reitter

IS-IT--Management
Sep 18, 2002
27
US
I've been working on this for MUCH TOO LONG and I can't get it.

I've got a main report that is group by Therapist and a subreport that is also grouped by the therapist. I'm linking the two reports by the same field and service dates. The sub report shows up in the right place on the main report. The problem is on my subreport I have a running total field named TotalHoursWorked. From this running total I created a shared variable called HoursWorked with the following formula:

WhilePrintingRecords;
Shared numberVar HoursWorked := ({#TotalHoursWorked});

In the Main Report the Shared Variable field is HoursWorked and its formula is:

WhilePrintingRecords;
Shared numberVar HoursWorked

The problem is the numbers don't match. For instance the field in the subreport will be 74 and in the main report it will be 10??????????????

This is my first try with both subreports and variables so any help would be gratefully appreciated.

Thanks Kim
 
Make sure that the formula in the main report is in a section that occurs AFTER the subreport's section. If they are in the same section you will usually get the value of the previous subreport. You can split the section into 2 pieces if needed. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
You Rock!!!!!

Thank you!!!!!!!!!
 
Glad Ken sorted the problem out. Just one further comment if anyone does a search on this in the archives.

There is a problem in one specific edition/release of Cr8.0 that doesn't handle shared variables properly. At my client site, one machine could process the report correctly, while a second PC had really screwed up shared variable values. A service pack from CR fixed this. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top