views:

3168

answers:

1

There are 2 subreports in detail section of my report.

I have enabled suppress blank for subreports.

Now i want to suppress detail section if both subreports have no data i.e. both are suppressed.

I searched a lot on web but did not find a solution.

+3  A: 

I'd first recommend against inserting subreports in the details section if at all possible because the subreport will be run for each record that the original report retrieves. If the report has 1000 rows it would be similar to running 1000 reports (thought not exactly).

That said, you have a couple of options.

You should be able to go into the section expert and check "Suppress Blank Section" for the Details section if you've already suppress the subreports.

If that does not work for you, you can create a formula field in each subreport that contains a shared variable that you populate the row count of the subreport. Then in the Suppress Formula (X+2 button) for the details section in the section export you can use those shared variables to enter a formula for the suppression of the section.

Here are a few links on using shared variables:

http://msdn.microsoft.com/en-us/library/ms225625(VS.80).aspx

http://books.google.com/books? id=eukKHY9wjAEC&pg=PA316&lpg=PA316&dq=crystal+reports+passing+data+from+subreport&source=bl&ots=O8BzfeMJOK&sig=kt2v5JPbgy1bofCG6mFy4b5Qybk&hl=en&ei=wyKhSoWeHoqDngf4xZ35BA&sa=X&oi=book_result&ct=result&resnum=8#v=onepage&q=crystal%20reports%20passing%20data%20from%20subreport&f=false

Dusty
Thanks for your reply. I am agrre with you to not putting subreport in detail section. However, the data on the main report is less than 300, so i choose to put it into detail section. Your suggestion works and i got what i was looking for.
Manjoor