Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

ppvariable & blankwhenzero

edited December 2001 in General
Hi,

Using ppvariable with displayformat of 0% and a field data type of double.
When zero value field displays as 0%
I want to suppress this and display spaces when zero.There is no
blankwhenzero property on this component. I've tried using onformat event as
follows
'if value = 0 then text := ' ';
This works for the zeror case but I lose my formatting
when value is non zero, ie I get a figure containing umpteen deciamla places
and not % formatting. I've tried resetting the displayformat ifvalue not =
zero but no go.

Am I on the right track or is there a much simpler solution.

Cheers

Tony Peppercorn

Techpoint software

Comments

  • edited December 2001
    Tony,

    what about setting the Visible Property of the ppVariable, does this work?

    Stefan Paege

    On Sun, 30 Dec 2001 17:17:42 -0600, "Tony Peppercorn"
  • edited December 2001
    Stefan,

    That is another approach I hadn't considered and will probably give me a
    viable workaround. However, I think I would have to use another event, as
    the problem with onformat is that it seems to assume as soon as you provide
    a procedure for it to go to that all the formatting is undone and it assumes
    you will do all your own formatting.

    Cheers

    Tony
  • edited January 2002
    Tony,

    don't use any OnFormat event handler at all. Use OnPrint with this code:

    if ppVariable1.Value < 0.001 then
    ppVariable1.Visible := False
    else
    ppVariable1.Visible := True;

    It's never a good idea to check a double against an exact value (0 in this
    case), so I use < 0.001 in this example. You have to adjust the value to
    your needs.

    elektronik-labor Carls GmbH & Co. KG
    Stefan Paege

    Kontakt: +49 (0)5973 9497-23 Fax: +49 (0)5973 9497-19
This discussion has been closed.