Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 3 Jahren, 10 Monaten
Letzter Beitrag:
vor 3 Jahren, 10 Monaten
Beteiligte Autoren:
John Marrone Jr, Mike H, Ola, Toddy Utomo

[WD18] Change a numeric table column from a 0 value to just a blank cell [Solved]

Startbeitrag von John Marrone Jr am 19.08.2014 04: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. I want these cells with a 0 in them to just display an empty cell. Is this possible to do with a column that is defined as numeric? I am filling this table from a query so the table is link to a query and the columns are link to the fields in the query. I have tried this code in the Row Display event but it doesn't work.

if myself[myself].R1 = 0 then myself[myself].R1 = ""
and
if myself[myself].R1 = 0 then myself[myself].R1 = NULL

Neither way works. Anybody have any ideals??

Thanks for any help that anyone can give me.

Antworten:

Re: [WD18] Change a numeric table column from a 0 value to just a blank cell

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!:)

Best regards
Ola

von Ola - am 19.08.2014 06:58

Re: [WD18] Change a numeric table column from a 0 value to just a blank cell

Try this

Before printing ITEM_Numeric

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

HTH
Toddy

von Toddy Utomo - am 19.08.2014 07:49

Re: [WD18] Change a numeric table column from a 0 value to just a blank cell

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.

von John Marrone Jr - am 19.08.2014 13:03
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

von Mike H - am 19.08.2014 14:10
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.

von John Marrone Jr - am 20.08.2014 16:01
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.