Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I suppress execution of a subreport? 1

Status
Not open for further replies.

SharonKelly

Technical User
Dec 2, 2003
4
US
Hello,

I'm using CR 8.5 and have determined that to meet a certain requirement for the report I'm working on, I need to place up to 10 subreport links (these would be links to the same subreport) in order to replicate the report contents a variable number of times (based on a value calculated in the stored proc and available to the report). My question is -- is there a way of suppressing the actual execution of the those extra links if they are not needed?

This report generates a big label (7-1/2 X 3-1/2). In general the report generates just one label each time it is run (which is triggered by events in the application it is embedded in). But based on info I can calculate and send in from the stored proc, I may need to print 2, 3, or as many as 10 labels. There would not be a way to simply rerun the report from the application -- this replication has to occur within the single triggered run of the report.

The only way I can think to do this is to set a variable @NumLabels, and have up to 10 subreport links to the label-generating report. I would suppress the subreport link instances greater than the value of @NumLabels.

But if this doesn't suppress execution, it would seem terribly inefficient to generate 9 unused label sets each time the report is run.

I would love to hear any insights you may have.

Thanks!
Sharon
 
What I have done on some of my reports

Create a parameter and place it in the Report Header and suppress it

#SuppressIt

I used a simple string with Y and N values

If your subreports are in separate sections by itself like mine are then suppress the section and go to x-2 and insert the following formula

{#SuppressIt} = "Y"

If the subreport is mixed with other fields within a section, right click on the subreport... format... and go to the common tab click on the suppress and then x-2 and add the same statement as above.

 
Thanks, wichitakid! My subreport invocations will each be in their own separate sections so no problem suppressing.

But my question is: will that suppression actually suppress the invocation of the subreport (and thus keep its stored proc from having to execute)? Or does it just suppress the writing of the data to the report? I hate to think of executing the subreport 10 times, just because once in a blue moon the report will need to have 10 labels instead of the usual 1.
 
The suppress will prevent execution of the subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top