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

Number Fields

edited December 2004 in General
Report Builder 7.04

All,

Sorry if this is a dumb question but, can I make a Number field show a 0 if
it is null without the need for a calculated field?

Thanks,

Paul.

Comments

  • edited December 2004
    Hi Paul,

    Try using the DetaiBand.BeforePrint event to check the value of your
    datafield and set the text property accordingly.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2004
    Hi Nico,

    Tried that with the following much simplified code.

    procedure DetailBeforePrint;
    begin
    DBText1.Text := '1.5';
    end;

    This doesn't change the text at all. Have I missed something in your
    explanation?

    Regards,

    Paul.

  • edited December 2004
    Hi Paul,

    Sorry, it may be easier if you replace the DBText with a TppVariable, then
    assign the Value property inside the BeforePrint event.

    uses
    Variants;

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    if ppReport1.DataPipeline['AmountPaid'] <> null then
    ppVariable1.Value := ppReport1.DataPipeline['AmountPaid']
    else
    ppVariable1.Value := 0;
    end;



    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.