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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport supression question

Status
Not open for further replies.

dswitzer

Technical User
Aug 2, 2002
298
US
I'll preface this by saying I'm still pretty new to all the abilites of CR (currently using CRXI).

My primary goal here is to speed up this report as I generate a pdf.

I have a report that lists some detail records (in "Details a"). If a particular field exists, I have a subreport in "Details b" that shows some additional detail (expanding on the record in "Details a").

I know by a field in the "Details a" record whether I need the subreport displayed -- and want to suppress the subreport (for speed) when no records exist.

The first way I did this (try#1) was: under Report Options of the subreport - I checked the Suppress Printing if No Records Option.

Then, I searched the forum and found a second way(try#2): I went to the Section Expert on the main report and under the Suppress Blank Section option, I added the code:
Code:
WhilePrintingRecords;
{test_spclPricing.OPTION TO}=""

Both ways give me the results I am looking for.

My understanding is that my try#1 evaulates the subreport every time, but in try#2 -- the subreport is only evaluated(and displayed) if the supression code allows it. So, I expected a large performance gain -- but saw no performance gain at all.

Any suggestions?
 
The #2 method should not have whileprintingrecords, that will prevent the sql from being passed to the database, and just in case, try:

isnull({test_spclPricing.OPTION TO})
or
{test_spclPricing.OPTION TO}=""

Then check the Database->Show SQL Query to make sure that it's passed to the database.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top