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

Variables...

edited June 2001 in General
In my report I have some variables of type 'extended' and I specified for
them a displayformat ('#,0.#0').
Everything works fine and the values are calculate properly, but I do not
want the report to print '0.00' if the value is zero or null. I can't find
the blankwhenzero property as for istance the dbcalc has. I solved it in a
by inspecting the variable value and setting the text property to null if
the value is zero, but I don't like that way very much! Is there a better
way?

Marco Carboni.

Comments

  • edited June 2001
    Since you're using TppVariable and OnCalc, that's sort of the nature of the
    beast. That control is expecting you to provide a value. However, it
    shouldn't be adding more than a line or two of code:

    procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
    begin

    Value := '';

    if (myValue > 0) then
    Value := FloatToStrF(...);

    end;

    --
    Robert Leahey
    TRX Technology Services
This discussion has been closed.