Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditionally formatting numeric fields
Message
From
26/04/2008 17:00:37
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01312990
Message ID:
01313314
Views:
10
>>Sergey,
>>That's it! Thank you.
>>********************
>>Naomi,
>>when you have VFP at hand, please try it:
>>make report,
>>set DE to use home ()+"labels"
>>add one field for ckval
>>write in the format expression (you will find on page Format of the Field Properties form)
>>
>>iif(readonly=.f., alltrim(transform(ckval, "@ 999,999,999.99")) + " + ", transform(ckva,"@ 999,999.99"))
>>
>>I see only stars.
>>
>>For timebeing I will use Sergey's elegant solution, easier for future maintenance anyhow.
>>Definitely good bye for today.
>>Koen
>
>Wow. I just re-read your message again. Why did you try to put this expression in the Format? I meant, that you just need to put the expression as is in the field itself, not in the format. In other words, you format the field the way you want using TRANSFORM function.

CkVal is a 16-bit CRC, so it's no larger than 65535. I just did
BROWSE FIELDS cc=PADR(iif(readonly=.f., alltrim(transform(ckval, "@ 999,999,999.99")) + " + ", transform(ckval,"@ 999,999.99")), 10)
and it shows right, as expected - each of them with a plus, of course. Though, this works... accidentally. Maybe like this:
BROWSE FIELDS cc=PADR(iif(ckval%2=1, alltrim(transform(ckval, "@l 999,999.99")) + " + ", transform(ckval,"@z 999,999.99")), 10)
First, whatever would go in the Format field in a textbox, goes between the @ and the space - R, L, Z, $, anything. Second, all the nines, commas and periods go not into Format but InputMask, at least on a form - now this is a label, and there's no way to keep the formatting under programmatic control, so the expression like the one I used here in the browse goes into the Expression. IOW, we can't have alias.field in the expression and some programmatic mumbo-jumbo in the Format tab, but we can have a programmatic expression in the expression tab.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform