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

TppDBCalc, dcCount, empty dataset

edited February 2002 in General
D5, RB 6.03

I have a TppDBCalc with DBCalcType = dcCount. When the dataset is empty, it
prints 1. It works fine in other cases.

Thanks,
George

Comments

  • edited February 2002
    One detail band does print if there is no data, and the DBCalc shows 1.
    There is a NoDataBehaviors property on the report which gives you some more
    control over what happens when there is no data. You may want to code a
    TppVariable to calculate with an Inc() call. Then if the record count is
    zero, then the variable's value can be set to zero.

    Set the Report.NoDataBehaviors to include ndBlankReport. Then check this in
    the OnCalc of the variable:

    uses
    ppTypes,
    ..
    if ppdaNoRecords in ppReport1.Datapipeline.State then
    Value := 0
    else
    Value := Value + 1;
    ..

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Yes, I know that there are various work-arounds, but it would be nice if it
    just worked properly.

    George

  • edited February 2002
    Thanks, I agree that a data aware counter should display zero if there are
    no records, even when one empty detail band prints. I was just trying to
    get a solution to ya:)


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    This has been fixed for the next release.

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.