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 Variables for sharing formulas between main and sub rpts

Status
Not open for further replies.

deborahyr

Technical User
Nov 14, 2002
63
US
Can someone explain shared variables to me like I'm a 4 year old? :)
I have some banding formulas in my main report that I'd like to share in my sub report, i.e. age bandings, tenure bandings. I am using Crystal XI. How do I eliminate the need to redo these formulas in the subreport? Thanks.
 
Please explain in what report section the subreport is located and in what section of the main report you want the values shared.

-LB
 
My Ageband and Tenureband formulas are in Detail A section of the mainreport and I would like to use these same bandings in my sub report in Detail C section. I have summaries of these bandings in the main report header also. Thanks.
 
Okay, what datatype are your formulas? Strings, numbers, dates? If you run your mouse over each formula, what is the datatype shown in the tooltip text?

-LB
 
Then in the detail_a section, create this formula and suppress it:

whileprintingrecords;
shared stringvar ageband := {@ageband};
shared stringvar tenureband := {@tenureband};

Then in the subreport, you can reference these in separate formulas:

whileprintingrecords;
shared stringvar ageband;

whileprintingrecords;
shared stringvar tenureband;

Not sure what you want to do with the values in the subreport.

In the main report, you should probably also add a reset formula in a detail_d section (which can be suppressed):

whileprintingrecords;
shared stringvar ageband := "";
shared stringvar tenureband := "";

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top