ppDBCalc Question
I have a subreport defined as a section type. To find the number of records
printed, I used a ppdbcalc field, set it to the "count" calculation type and
picked a field from the result set. I put the ppdbcalc field in the
subreport's summary section. If the results set is empty, the count is
displaying "1". How can that be when there are no records printed? I was
expecting a "0".
Second question: if there are no records, what is the best way to not print
that section of the report? Should I manually open the datasource, check
the record count, then make the subreport invisible if it does not need to
print (like this: ppsubreport2.Visible:= not
TDatasouce2.Dataset.IsEmpty) ?
Thanks!
Debbie
printed, I used a ppdbcalc field, set it to the "count" calculation type and
picked a field from the result set. I put the ppdbcalc field in the
subreport's summary section. If the results set is empty, the count is
displaying "1". How can that be when there are no records printed? I was
expecting a "0".
Second question: if there are no records, what is the best way to not print
that section of the report? Should I manually open the datasource, check
the record count, then make the subreport invisible if it does not need to
print (like this: ppsubreport2.Visible:= not
TDatasouce2.Dataset.IsEmpty) ?
Thanks!
Debbie
This discussion has been closed.
Comments
Which version of ReportBuilder are you using? In my testing with RB 10.03
Build 2, I created a report with a subreport in teh detail band and
connected it to an empty dataset. Then I placed a count DBCalc in the
summary band of the subreport. When previewing the report, the DBCalc
component shows "0".
You can adjust the NoDataBehaviors of the subreport to ndBlankPage if you
would not like to see any part of the subreport. You can also use the
OnNoData event if you would like to show a message or hide certain
components.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
ReportBuilder 10 is available for Delphi 6, 7, 2005, and 2006. I would
recommend downloading a trial edition of ReportBuilder 10.03 for Delphi 6
and testing some of your report with it. Be sure you back up any template
files you already have as they will be changed once they are loaded into the
newer version. Also, before installing, be sure you have a backup of the RB
6.x installation file in case you decide to revert back to the older
version.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com