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

Crystal syntax problem 1

Status
Not open for further replies.

iemproductions

Programmer
Jan 30, 2002
203
US
Hello,

I'm teaching myself how to create formula fields and I've gotten stuck. I'm trying to write a formula that will check the value in a field. If it's less than or equal to 10, I want a check mark to appear in the field.

I get the error message The ) is missing. I can't figure out where it's missing. Any help would be greatly appreciated.

This is the formula

If {Purchases.Units in Stock} <= 10 Then Chr(0xFC) Else DefaultAttribute

I'm using Crystal Reports for Visual Studio 2005.

Any help would be greatly appreciated.
Thank you
 
What does Chr(0xFC) return if you place it in a formula by itself and put it on the report?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Try:

If {Purchases.Units in Stock} <= 10 Then
Chr(254) Else chr(120)

Create this formula in the formula editor->new and then place it in the detail section. Finally, you must right click on it->format field->font->choose "Wingdings" as the font.

It appears that you were trying to create this formula in a formatting area based on your use of "defaultattribute".

-LB
 
Thank you so much LB. I think there is something wrong with my character map dialog box. It use to show chr(254) like you typed. I noticed that the character set, group by and searh for fields at the bottom of the dialog box are grayed out when the wingdings fonts are selected or the symbol font. Do you think there is something wrong with my fonts?
 
Hi dgillz,

I created another formula field and used Chr(0xFC)as the only thing inthe formula. I get the same error message that the ) is missing.
 
I think it fails to recognise 0xFC as a possible character value.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I don't know what dialogue box you are referring to. If you follow the steps I outlined above, don't you get the correct results?

-LB
 
hi lbass,

the dialog box that i am referring to is the character map dialog box.

i put in the code just as you typed it. i get the check mark in a box. i wanted to use just the plain check mark.
on rows where the value is greater than 10, i get a box with an x in it. i just want those records to be blank.
 
With boxes, it should be:
If {Purchases.Units in Stock} <= 10 Then
Chr(254) Else chr(168)

Without boxes:
If {Purchases.Units in Stock} <= 10 Then
Chr(252) Else ""

These formulas need to be formatted to use the Wingding font to work.

Still don't know where you are getting the character map--sounds like Word to me, not CR.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top