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!

Shared Variables In Main Report

Status
Not open for further replies.

msanders67

Technical User
Sep 3, 2002
16
US
I've created a report that pulls in a numeric field and have created a subreport to pull in another. I have shared the variable from the subreport (which is linked to the main report). The value of the shared variable is showing up one record after it should.

Example:

curr_yr_mtd pyr_mtd shared_pyr_mtd
10,000.00 15,000.00 .00
8,000.00 17,000.00 15,000.00
18,000.00 10,000.00 17,000.00

The pyr_mtd and shared_pyr_mtd fields should be equal. I am printing the shared variable on the subreport and is in fact what is showing up as the pyr_mtd, but when I try to use it in a calculation, it's apparent that it's off by one detail record.

Any ideas how I can get the data in line?

TIA,
Margo
 
It sounds like you have the subreport and the shared variable in the main report placed in the same section.

You don't want this, because the variable isn't getting assigned by the time you want it displayed, meaning that it'll always be late in terms of displaying the right value.

Ideally, the subreport should precede any shared variable reference in the main report by at least one section. Create another section, move it above your display section, and place the subreport in that. Instead of displaying the figure directly from the subreport in pyr_mtd field, use a shared variable for this instead, as well as another shared variable for the shared_pyr_mtd.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top