Remove the sub-report page if it has no data on a report

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

Guest

I have created a report having two sub-reports in it, to view sub-reports in
seperate page I use page break after sub-report, and in the sub-report's NO
DATA property I code it Me.Report.Visible = False., but when I view this
sub-report in report it shows blank page where the report has no data, I want
to know how to remove the page from the report if the sub report has no data.
 
In the Format event procedure of the section of the parent report which
contains the subreports set the Visible property of the Page Break control to
True/False on the basis of whether or not the subreport has data:

Me.YourPageBreak.Visible = Me.YourSubreportControl.Report.HasData

Incidentally you can do the same to hide/show the subreport control itself
rather than using the NoData event of the subreport:

Me.YourSubreportControl.Visible = Me.YourSubreportControl.Report.HasData

Note that 'SubreportControl' in the above is the name of the control on the
parent report which contains the subreport.
 

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

Back
Top