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

RESETTING SHARED VARIABLE

Status
Not open for further replies.

sfabry

Technical User
Feb 28, 2012
46
US
I am trying to reset a variable that is passing from my subreport to my main report. I have tried placing the reset formula in the header and footer of the main report and it is not working - the value from the previous shared variable carries over until there is a new value. Here are my formulas:

(subreport)
Report Header:
whileprintingrecords;
shared numbervar subreptotal:= ({@PT TOTAL})

(main report)
GroupFooter1a: Amount Reset
WhilePrintingRecords;
shared NumberVar subreportotal := 0;

GF1b: Subreport

GF1c:
whileprintingrecords;
shared numbervar subreptotal;
subreptotal + (Sum ({@sum charges}, {case_record.cr_urn}));

GF1c:
whileprintingrecords;
shared numbervar subreptotal;
subreptotal + (Sum ({@SUPPLY COST}, {case_record.cr_urn}));

I only have one group and the subreport is linked on the group's field ({case_record.cr_urn} = {case_record.cr_urn})


I am having the same problem as explained in thread149-120009 but I am not using a version of crystal that this bug/patch seems to apply. I am using Crytal 11. Any help would be appreciated!

 
You only get the correct value for the subreport in the section below the one which calls the subreport. Is that it?

I'd also say it was asking for trouble to use the same variable for two different functions, rather than having two and adding. But I can't see how this would cause the reported problem.

If nothing seems to make sense, do a test version that shows the values and even the raw data. Mostly some false assumption will be revealed.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top