• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 533
  • Last Modified:

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

0
taylort2
Asked:
taylort2
  • 4
  • 3
1 Solution
 
mlmccCommented:
Yes it is but you have to set it during the WhilePrintingRecords pass..
Variable values are not retained during other passes.

Change the WholeReadingRecords to WhilePrintingRecords

mlmcc
0
 
taylort2Author Commented:
The picture is always shown even if it's not suppose to.
0
 
mlmccCommented:
What formula changes the alue of bSuppress?

mlmcc
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
taylort2Author Commented:
In a Formula field, I am using

WhileReadingRecords;
Global BooleanVar bSuppress;

If {field.value} = 0 then
   (bSuppress := True;)
Else
   (bSuppress:=False;)
0
 
taylort2Author Commented:
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.
0
 
mlmccCommented:
Shared shouldn't matter since that is for sharing data with a subreport.  

mlmcc
0
 
taylort2Author Commented:
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.  


0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now