Solved

Hide/show a picture using global variable

Posted on 2009-05-12
7
512 Views
Last Modified: 2012-05-06
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
Comment
Question by:taylort2
  • 4
  • 3
7 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24368560
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
 

Author Comment

by:taylort2
ID: 24376968
The picture is always shown even if it's not suppose to.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24377231
What formula changes the alue of bSuppress?

mlmcc
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:taylort2
ID: 24377775
In a Formula field, I am using

WhileReadingRecords;
Global BooleanVar bSuppress;

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

Author Comment

by:taylort2
ID: 24378900
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 24379899
Shared shouldn't matter since that is for sharing data with a subreport.  

mlmcc
0
 

Author Comment

by:taylort2
ID: 24385394
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now