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

Formula Field using data of a subreport

Status
Not open for further replies.

cloperenamatias

Programmer
May 7, 2003
2
PR
The situation is the following:
I want to create a formula field on Report A based on a value that exists in my subreport B.

Example Report A have a product_code and the I link report A with report B with the product_code but I would like to have a formula field in report A that should check the value of product_description in report B. How I can make reference to product_description that exists on Report B.
 
Use a shared variable.

Prior to executing the subreport (section before), use the following:

whileprintingrecords;
shared stringvar Descr := "";

Go into the subreport and use the following code to obtain the Description:

whileprintingrecords;
shared stringvar Descr := {yourtable.descriptionfield};

After the subreport fires, use the following:

After the subreport fires you may use something like the following and reference the description:

whileprintingrecords;
shared stringvar Descr;
If descr = "Humdinger" then
"Wow, it's a humdinger"
else
"That ain't no shoot hot dang dipsticky Humdinger..."

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top