Link to home
Start Free TrialLog in
Avatar of taylort2
taylort2

asked on

Hide/show a picture using global variable

Is it possible to hide/show a picture using a global variable?

I am trying to use the code below for the picture suppression but it does not work.  I am getting "Formatting formulas must be print-time formulas."  Is there a way around this?

I am using a variable because the data is on a previous section which I am using to determine whether to Hide or Show the picture.
WhileReadingRecords;
global booleanvar bSuppress;
 
If bSuppress then
   True
Else
   False

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of taylort2
taylort2

ASKER

The picture is always shown even if it's not suppose to.
What formula changes the alue of bSuppress?

mlmcc
In a Formula field, I am using

WhileReadingRecords;
Global BooleanVar bSuppress;

If {field.value} = 0 then
   (bSuppress := True;)
Else
   (bSuppress:=False;)
I fixed the problem.  Using WhilePrintingRecords; that you suggested, I also changed the Global to Shared and the code now works.

WhilePrintingRecords;
Shared BooleanVar bSuppress;

If {field.value} = 0 then
   (bSuppress := True;)
Else
   (bSuppress:=False;)


WhilePrintingRecords;
Shared BooleanVar bSuppress;
 
If bSuppress then
   True
Else
   False

Thanks for the Assist.
Shared shouldn't matter since that is for sharing data with a subreport.  

mlmcc
I am using Crystal Reports XI Release 2 SP5.

Crystal Reports is and has been flaky since Business Objects took over and now with SAP, it's worst just like their website.