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

DBCalc count variable incorrect

edited March 2002 in General
I have a count DBCalc in a group footer. If this group is empty, the count
shows 1. I don't want to have to write lots of code to calculate the correct
amount for each group, so I would prefer it if the count would just show
correct. Please advise on why this happens, and how to get it to calculate
correctly. Thanks.

Peter Brennan,
DPN Software,
peter.brennan@dpnsoftware.com

Comments

  • edited March 2002
    There are two ways aroud this. You can either create a short OnCalc event
    handler for the DBCalc. In it check if ppReport1.DataPipeline.State is equal
    to 'ppdaNoRecords' (found in ppTypes). If so, set the DBCalc1.Value to 0.
    The other option is to set ppReport1.DataPipeline.SkipWhenNoRecords property
    to True which will skip empty groups entirely.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited March 2002
    The second method suggested is no use, as we need the count, even if the
    group is empty. When I try datapipeline.state=ppdaNoRecords, I get the
    compilation message 'Incompatible types'. Thanks

    Peter Brennan
    DPN Software
    peter.brennan@dpnsoftware.com

  • edited March 2002
    Sorry, the State property is a set of values so the check you have to do is:

    if (ppdaNoRecords in ppReport1.DataPipeline.State) then ...

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.