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

CheckBox Display in Crystal Report 1

Status
Not open for further replies.

takume

Programmer
Mar 15, 2004
9
HK
Thanks for your reply about my problems. However, i don't know why it cannot display the checkbox and uncheck box ??? The following is my code of a formula field. I tested field1 is true by output some normal text but it cannot output Chr(254) and chr(168) ?? why ??

if {field1} = true then
formula = chr(254)
else
formula = chr(168)
end if
 
Try something like:

stringvar formula;

if {table.field} = true then
formula := chr(254)
else
formula := chr(168)

Note the colons.

-LB
 
LB: Actually, if you are using Basic syntax, then you don't need the colons. Based upon the fact that takume is using "formula =", I would say that is the case.

takume: Can you save and close your formula successfully?
if not, make sure that you have the syntax set to Basic in the the toolbar of the formula editor.
Once you can save it, are you getting any output at all?
If you are getting output, but not the checkboxs, then you need to change the font to Wingdings.
Select the field, and choose Wingdings in the font drop down list in the formatting toolbar.

If this doesn't work, then please provide more detailed information, plus Crystal Version, and database used.

~Brian
 
Oops--my ignorance of Basic revealed. Thanks for the correction, Brian. Looks like the Wingding formatting might be the key, as you suggest.

-LB
 
Here's another way to create checkboxes.

@Checkbox
numberVar vCheckbox := {table.field};
if vCheckbox = "true" then "<font face = wingdings>þ" else "<font face = wingdings>¨";
Right click, format, paragraph formatting, text interpretation and set to HTML text.

This allows you to keep the font style set to whatever your standard/default font is and still displays correctly.

You could also use the following special characters for different styles of checkboxes:
chr(253) = x
chr(252) = ü
chr(251) = û
 
I've been trying to get the blank check box to show.
Here are the 2 formulas I tried

stringvar formula;

if {JobSpecPrepress.Work-Center-ID} = "100" and
{JobSpecPrepress.Operation-ID} = "100" then
formula := chr(254)
else
formula := chr(168)


and


if {JobSpecPrepress.Work-Center-ID} = "100" and
{JobSpecPrepress.Operation-ID} = "100" then
chr(254)
else
chr(168)


Also tried reverse psychology:

if {JobSpecPrepress.Work-Center-ID} <> "100" and
{JobSpecPrepress.Operation-ID} <> "100" then
chr(168)
else
chr(254)


Neither work. I get the checkbox if the questions are met, but get nothing if they are not met.
Thanks for your help
 
I just did some more checking and found that the boxes do not show when I have more that one subjob.
Example:
One subjob
100 100 = checkbox
"" "" = blank box
two subjobs on one job
subjob1
100 100 = nobox
subjob2
100 100 = nobox
I guess what I need to know is how can I consolidate multiple yes answers to give me a checkbox. I also need to keep in mind that I need to total the hours estimated to do the work
thanks
 
Are you putting the formula in the details section? What do you mean by consolidating multiple yes answers into a check box? If you want the checkbox at the group level, is it at the job level or the subjob level? What if one or more subjob meets the criteria and another one doesn't? You need to specify the rules for the check mark and also show us your group structure and at what level you want the checkmark.

-LB

 
I figured it out:
IF (Count ({JobSpecPrepress.Work-Center-ID}))>=1 and
{JobSpecPrepress.Work-Center-ID} = "100" and
{JobSpecPrepress.Operation-ID} = "100" then
chr(254)
else
chr(168)

Works Great.
Thanks to all
 
I think you're going to have trouble with your formula. Adding the initial clause does nothing since all groups will meet that criterion.

-LB
 
It seems to work in all situations. What would be the better soloution?
Thanks
 
I don't know--you didn't answer my earlier questions, so I don't have enough information. If it seems to be working, then I shouldn't have second guessed you probably--I just couldn't see why it would work any better than your original attempts.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top