Keep Subreport Visible w/o Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have a report that contains a subreport with data from a related table. If there is no data to display in the subreport, it doesn't show up on the report.

How can I override this behaviour and get the subreport to show regardless of whether it has data or not? I have a couple of blank lines to add after the data and if there is no data, I would like the blank lines to show up.

Thanks,
 
Greg said:
I have a report that contains a subreport with data from a related table. If there is no data to display in the subreport, it doesn't show up on the report.

How can I override this behaviour and get the subreport to show regardless of whether it has data or not? I have a couple of blank lines to add after the data and if there is no data, I would like the blank lines to show up.


Create a text box of the approprite height and place it on
top of the subreport control. Then use code in the Format
event of the section contaning the subreport.

Me.thetextbox.Visible = Not Me.subreport.Report.HasData
 
Thank you for the reply, Marshall. I'm still not able to get the subreport to show up if there is no data. I'm confused as to how putting a text box on top of the subreport would affect the subreport showing up. I tried it but to no avail.

Thanks,
 
Greg said:
Thank you for the reply, Marshall. I'm still not able to get the subreport to show up if there is no data. I'm confused as to how putting a text box on top of the subreport would affect the subreport showing up. I tried it but to no avail.


Sorry, I should have explained that a subreport with no data
will never, under any circumstances, show up.

What I was suggesting is that making a blank text box
visible would reserve the amount of space in the text box's
Height (just make sure the text box's CanShrink property is
set to No.
 
Back
Top