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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT - VB6 Crystal Reports 4.6 Boolean Formula Syntax!!

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I’m very new to Crystal Reports and I’m unsure of the correct syntax to use. If a 1 is displayed in a database field i'm trying 2 display the word "Mandatory". ie:

if {tblItem.Mandatory} = ‘1’
then
else

Do I need single/double quotes around the Boolean? Also a big question is how would I then print a word into the report in the then clause??

then print “MANDATORY” ??????????????

Also what do i need to put in the 'else' part just to end the statement without an error being given.

Thankx for all your help.
Jonathan

 
You can use single or double as long as they match. If the field {tblItem.Mandatory} is a string then use the following:

if {tblItem.Mandatory} = ‘1’
then "Mandatory"
else "Not Mandatory"

If it is a numeric use:

if {tblItem.Mandatory} = 1
then.... Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Thnx that works 110%!! :eek:)

I'm also trying to display a square box along with the word "Mandatory" so that users can tick it when the report is printed.

Is there an ASCII code to display a square tick box or can this be drawn easily enought using a formula??????

Thnx again,
Jonathan
 
Hi,

Does anyone know how to insert a custom sized box using a formula?? If a certain field is populated?

Something like:
-------------------------------

If {table1.Item} = 1
then "DISPLAY BOX?????????"
else ""

-------------------------------
Any idea's?

Thnx,
Jonathan
 
Boxes can't be conditional, however borders (boxes around a field object) can be conditonal. If you create a formula that is literal spaces in quotes, you can put a conditional border around it and get an empty box on demand. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top