How to test for an empty detail band
Hi,
for some reason I had some prints with empty detail-bands. Since this
must never happen, the user should be informed and an error-message
should be raised.
Which is the best way to check for an empty detail-band after printing?
I found OnNoData, but that seems to refer to the master-record as well.
thanks and regards Uli
for some reason I had some prints with empty detail-bands. Since this
must never happen, the user should be informed and an error-message
should be raised.
Which is the best way to check for an empty detail-band after printing?
I found OnNoData, but that seems to refer to the master-record as well.
thanks and regards Uli
This discussion has been closed.
Comments
When you say "empty" detailband, do you mean that it contains no report
components or that there is no data being printed?
For the former you could use a report object loop to check if there are
components present inside a band.
For the latter, you could simply check the proper field values before
the band prints and determine whether the band will display anything or not.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
That's what I meant.
As I mentioned, there were some reports with blank detail bands printed.
Normally the database should *always* contain data.
The question is: is it possible that rb doesn't print a detail band
though there are data in the detail-table without raising an error?
In either case I would like to display a warning message.
Thank you. Regards Uli
You could use the DetailBand.BeforePrint or BeforeGenerate event to
check the appropriate fields. If they are empty, you could display a
message, or hide all components inside the detail band so it does not
display.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com