Connecting Tech Pros Worldwide Forums | Help | Site Map

How to Not Print invisible Subreports

Newbie
 
Join Date: Dec 2008
Posts: 7
#1: Dec 24 '08
Hi

I have a Report made up of 8 Subreports for Knitting Instructions for knitting Garment parts such as Body, Sleeves, Collar, Bands. However, some garments do not have a collar (i.e. a Vee Necked cardigan), so I don't want this subreport to print.

I have made the Subreport invisible, but I still get a blank page where that subreport should appear.

How do I tell it not to print the invisible subreport, and not to leave a space where that subreport would print if it were visible.

I cannot use the Property for No Data, as there is data on the report (a field stating that the Collar Type = N/A, and an OLE picture of the Vee Band, showing why the Collar is Not Applicable). I just don't want to have to print that data.

Many thanks for your ideas

Viv.

nico5038's Avatar
Moderator
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,232
#2: Dec 24 '08

re: How to Not Print invisible Subreports


Easiest way is to make the height of the subreport as less as possible (just one line) than make sure the "CanGrow" property is set to "Yes" and you're in business :-)

Nic;o)
Newbie
 
Join Date: Dec 2008
Posts: 7
#3: Dec 24 '08

re: How to Not Print invisible Subreports


Thanks Nico - That works fine.

However, as I am a complete beginner with VBA and am on a very steep learning curve, how would I tell it not to print the invisible subreport using code?

Viv
nico5038's Avatar
Moderator
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,232
#4: Dec 24 '08

re: How to Not Print invisible Subreports


Hi Viv,

Check out: Suppress Sub Report when a field in that sub report is blank
Instead of the Null (or 0) code there you would need to check or the sub report's query doesn't return records.

Nic;o)
Newbie
 
Join Date: Dec 2008
Posts: 7
#5: Dec 24 '08

re: How to Not Print invisible Subreports


Thanks Nico. Could not get the code to run without the same Error Message as your last person. However, Report is now doing exactly as I want, not showing Subreports where there is no Collar or Bands.

Thanks again.
Viv
nico5038's Avatar
Moderator
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,232
#6: Dec 24 '08

re: How to Not Print invisible Subreports


Glad I could help, success with your application !

Nic;o)
Reply