If controls in subreport are null, dont print black page

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

Guest

/diagram
<header>
<subreport1>
<subreport2>
<subreport3>
/end diagram

each sub report eats a full page.
i am testing for null and setting the visibile property of the subreport and
page break to false. still getting a blank page (with header) for the hidden
subreport.

on the details format event:
if isnull(Report_thatreport.thatfield) then
Report_thatreport.visible = false
me.pagebreak.visibile = false
'me.detail.height = me.detail.height - height of subform
end if

its finding the null and setting the visible property correctly. Its also
finding the page break and setting that propert correctly. I am still getting
a blank page [with header].
If the subreport contains no information then i need to not print that page.
 
You need to test the HasData property of the subreport. A subreport that has
no data will automatically be invisible. You should only need to worry about
the page break control.

'Me.Report_thatreport.visible = (Me.Report_thatreport.Report.HasData)
me.pagebreak.visibile = (Me.Report_thatreport.Report.HasData)
'me.detail.height = me.detail.height - height of subform
 
jsteeves said:
/diagram
<header>
<subreport1>
<subreport2>
<subreport3>
/end diagram

each sub report eats a full page.
i am testing for null and setting the visibile property of the subreport and
page break to false. still getting a blank page (with header) for the hidden
subreport.

on the details format event:
if isnull(Report_thatreport.thatfield) then
Report_thatreport.visible = false
me.pagebreak.visibile = false
'me.detail.height = me.detail.height - height of subform
end if

its finding the null and setting the visible property correctly. Its also
finding the page break and setting that propert correctly. I am still getting
a blank page [with header].
If the subreport contains no information then i need to not print that page.


Testing for Null doesn't work if the subreport has no data,
because the control your testing has no value, not even
Null.

Instead of that, test the subreport's HasData property:

If Report_thatreport.Report.HasData Then
Report_thatreport.Visible = False
Me.pagebreak.Visibile = false
. . .
 
Back
Top