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 variable between 2 sub-reports

Status
Not open for further replies.

tekniks

Technical User
Jun 27, 2003
98
US
Hi,

I want to access a shared variable value in a sub-report that is below another sub-report having the same shared variable, however the shared variable is not returning the true value.

This is what I have in Sub-report A(CR 8.5):

@FM_CM_Flag // in the header section
Whileprintingrecords;
shared booleanvar FM_CM_Flag;

if ({MM_GENEALOGY_LG_2.MATERIAL_ID} like 'FM'+ '*' OR {MM_GENEALOGY_LG_2.MATERIAL_ID} like 'CM'+ '*') then

FM_CM_Flag := True

else

FM_CM_Flag := False

This is what I have in Sub-report B:

@FM_CM_Flag // in the header section
Whileprintingrecords;
shared booleanvar FM_CM_Flag;
FM_CM_Flag

Problem:

In the Sub-report A the value of FM_CM_Flag is True where as in the Sub-report B(below Sub-report A) the value of FM_CM_Flag is False although it should be True
Based on the value of this variable in the Sub-report B, I want to suppress or display certain fields.


Thanks for all your help in advance.

Tek
 
Can you verify that the flag is still true in the footer section of Subreport A? Try placing the following in the subreport A footer to check this:

whileprintingrecords;
shared booleanvar FM_CM_Flag;

Where are the subreports placed? In the report or a group header? What are the links between the subreports and the main report? Have you ruled out nulls in the Material ID field?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top