PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD18] Change a numeric table column form 0 to just a blank cell
[WD18] Change a numeric table column form 0 to just a blank cell
Débuté par John Marrone Jr, 19 aoû. 2014 06:00 - 5 réponses
Posté le 19 août 2014 - 06:00
Hi

I have a table and some of the columns are numeric. I would like to change the cell value from 0 to just an empty cell. Is this possible to do with a column that is defined as numeric? Thanks for any help that anyone can give me.
Posté le 19 août 2014 - 08:58
Hi John

I have WD19 open in front of me, and there in the general tab of the table control's description window there is a check box "Reset if zero". I think this exists also in WD18. Just check it on. It even works!<img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":)">

Best regards
Ola
Posté le 19 août 2014 - 09:49
Try this

Before printing ITEM_Numeric

IF MySelf = 0 THEN
MySelf..InputMask = "S"
END

HTH
Toddy
Posté le 19 août 2014 - 15:03
Hi Ola and Toddy

The Reset if Zero worked like a charm 10 years using WD and never used that checkbox. And your right Ola, it even worked. I thank you and Toddy for your time and effort to help me out.
Posté le 19 août 2014 - 16:10
Hi, John,

Reset if Zero is not available in WD11. But I found a way of implementing the effect you want without any coding. I discovered that the numeric masks in WD11 are similar to those in Excel. So I use a mask like
"9,999.99;[RED]-9999.99; "
The first format (before the first semi-colon) is used to display POSITIVE values
The second format (between the two semi-colons) is used to display NEGATIVE values
In this case I can even specify that it display in a different color
After the second semi-colon there is a single space which displays a blank for ZERO values.

Not as easy as checking a box but the different color highlights negative values.

- Mike Hilado
Posté le 20 août 2014 - 18:01
Hi Mike

Thanks for the example, it works really great and being able the change the font color foe negative values is a real plus. Is there more I should know like to also make the font bold or any other features? Thanks again.