?
Solved

Hide/show a picture using global variable

Posted on 2009-05-12
7
Medium Priority
?
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 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 101

Expert Comment

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

mlmcc
0
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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 101

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

764 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