set sub report height

I

iccsi

I have sub report on the main report and would like to set the height
to zero and invisible when there is no record in the sub report.


I tried to set all controls to can shrink and height to zero when
there is no record, but it seems the sub control invisible, but still
has some space blank on the sub report spot.


Are there any solution to set sub report height zero when there is no
record for the sub report?


Your help is great appreciated,
 
A

Allen Browne

1. Remove any controls (labels?) you have in the subreport's Report Header
or Report Footer section.

2. For the section of the main report that contains the subreport (Detail?),
set Can Shrink to Yes.
 
M

Marshall Barton

iccsi said:
I have sub report on the main report and would like to set the height
to zero and invisible when there is no record in the sub report.

I tried to set all controls to can shrink and height to zero when
there is no record, but it seems the sub control invisible, but still
has some space blank on the sub report spot.

Are there any solution to set sub report height zero when there is no
record for the sub report?

I don't understand your problem. Subreports with no records
do not display anything and all the subreport space will be
reclaimed if the subreport control's CanShrink property is
set to Yes.

I think there either is something else going on or you did
not set the CanShrink property.

Maybe you want to suppress the main report's detail when the
subreport is empty? If so, then all you need to do is add a
line of code to the main report detail section's Format
event:
Cancel = Not Me.[subreport control],Report.HasData
 

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