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

Crystal Reports 8.5 subreport and shared variable 1

Status
Not open for further replies.

cgilmore

Instructor
Mar 8, 2001
41
US
I need help, please. I have seventeen summary fields in the report footer of a Main Report. I have seventeen summary fields in the report footer of the subreport. From the main report I need to enter 17 formulas which grab a summary field from the subreport and subtract a summary field from the main report. Would I do this using shared variables? How do I do this?
 
This can be done in the following manner:
this is your shared variable formula that is in your subreport:
shared numbervar sub1 := {#count}

This is the shared variable formula in the main report that calls the subreport value (which you can then calculate off of)
shared numbervar sub1; sub1

Do this for each of the 17 fields and the values will be accessible in the main report.
-Bruce
 
In the subreport my first summary field is named @sum death incurred where it is summing reserves for all incurred deaths for a year. Money we haven't spent yet. I created a shared variable formula named shared death incurred and I typed the following:

shared numbervar deathinc := {@sum death incurred}
I also tried
shared numbervar deathinc := tonumber ({@sum death incurred}) thinking that would provide the value rather than the formula.

In the main report I created a formula for the shared variable named shared death inc main and I typed the following:

shared numbervar deathinc; deathinc

In the main report I have a summary field named @sum death which sums all death claims paid for a year. I then created a formula named outstanding death and I typed:

{@shared death inc main}-{@sum death}

I either did something wrong or it's because both my main report and my subreport are in the report footer of the main document.

 
Sounds like an evaluation time issue, the subreport has to be placed higher than the shared variable that you are bringing over. In such cases i will sometimes strip out all non-relevant data out of the subreport, and place it near the top of the report, then try placing the shared variable below that section and see if the formula you created is being populated. the subreport can be shrunk down in the upper portion of the report to where it is not noticeable.
Hope this helps! this can even be done for example in the following: split page header into section a and b, place subreport into setion a , place shared variable formula in section b and see if the shared variable populates. Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top