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!

How do you change Crystal Enterprise Options 1

Status
Not open for further replies.

Lseveron

Technical User
Feb 4, 2002
4
AU
Hiya

My formula worked fine through Crystal Developer AFTER I had gone File --> Options --> Fields --> Number --> Number and selected (1123) rather then system default Number Format

the formula is translating a BitField into a Boolean in the following way

numberVar i := {Bitfields};
numbervar j := 16;
stringVar x := totext(i mod 2);
while ( j > 0 ) do (i:=truncate(i/2,0);x:= (totext(i mod 2)) + x;j:=j-1;);
if x[4]='0' then 'Unlocked' else 'Locked'

The problem is after putting it into place running through Crytal Enterprise every record ends up being 'Unlocked' I belive this is because I can't find out where to change that option through Crystal Enterprise as mentioned before
and making the bitfield have 2 decimal places, although could also be anything else any help on this would be greatly appreciated.

 
Ah i think I see what you need.

Try changing totext(i mod 2) to totext(i mod 2, "#")

the "#" tells it to not add decimals, commas etc so that 10010001 comes out as exactly that, not 10,010,001.00. I haven't followed your formula the rest of the way through, but anyplace you are trying to get rid of decimals, commas etc from your string can be removed.

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top