Keep subreport with no records?

K

Kim NJ

I have a current report with a series of subreports. And it's working
wonderfully! Too well, in fact...

One of my subreports is pulling the total number of records from a certain
table. Unfortunately, there are times when there won't be records in that
table that match my criteria. However, I still want the subreport to display
with the 0 as the count.

When I open the subreport on its own, I see the 0 as the count. I've moved
the report data (3 simple items) up into the header, and then back down into
the detail with no avail.

I don't want the people recieving the report to think that we've neglected
the data. I need it to show with its very significant 0. How do I go about
making this happen?
 
M

Marshall Barton

Kim said:
I have a current report with a series of subreports. And it's working
wonderfully! Too well, in fact...

One of my subreports is pulling the total number of records from a certain
table. Unfortunately, there are times when there won't be records in that
table that match my criteria. However, I still want the subreport to display
with the 0 as the count.

When I open the subreport on its own, I see the 0 as the count. I've moved
the report data (3 simple items) up into the header, and then back down into
the detail with no avail.

I don't want the people recieving the report to think that we've neglected
the data. I need it to show with its very significant 0. How do I go about
making this happen?


A subreport with no records to report will not display at
all so you need to do something to display the 0 on the main
report.

The usual way to display the 0 is to put a text box control
on top of the subreport control on the main report. Set the
text box's CanShrink property to Yes and set its expression
to something like:
=IIf(subreportcontrol.Report.HasData, Null, "count 0")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top