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

Printing a zero when field is null

edited November 2004 in General
Hi.,

I am using D5 and RB7.0.

I am having trouble getting a field on my report to print a '0' when the
field is null. I have tried setting the DisplayFormat of the dbtext
component to '0' but this doesn't seem to work. But on other fields it does
seem to work.

Is there some trick here or something that I am missing?

Thanks for any help.

Matthew Pascoe

Comments

  • edited November 2004
    Matthew:

    This is the default behavior of the DBText field. I too experienced the
    problem and built my own descendent of TppDBText. If you want it drop me an
    email.


    Neil
  • edited November 2004
    I have had the same problem.

    what i do is have the db control and a label.
    the db control visible is false and the label visible is true

    i populate the label with the data from the dbcontrol
    with an if statement thrown in to populate the label with
    a 0.00 if the field is null.

    that is the easiest way around this problem.
  • edited November 2004
    Thanks, just wanted to confirm that I wasn't doing someting silly.

    Matthew

  • edited November 2004
    I jsut put a label with 0 or 0.00 behind the dbtext component, set its
    transparent property to false and make sure that autosize is set to true.
    If there is no data in the DBText it will resize to nothing and display the
    label behind it!!!
  • edited November 2004
    yep that is another way

    good job
This discussion has been closed.