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

How to toggle supreport visibility?

Status
Not open for further replies.

TheBugSlayer

Programmer
Sep 22, 2002
887
US
Hi. I have a subreport with a header (text box) and a table. I would like to display both only if the the datasource of the report contains data. Nothing that I have tried has worked so far. Also, is it possible to toggle visibility of the subreport inside the containing report?

Oh, I am using MS' s Report Viewer...

Thank you.

MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA)
 
Try this:

- Conditionally suppress ALL sections of your subreport if some key field in the data is null. This will make the subreport completely blank if there is no data.

- In the main report, turn on Suppress If Blank for the section that contains the subreport.

- Make sure that you "turn off" the borders on the subreport or else that section will never be blank.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Hi Hilfy. Thank you so much for your reply. I still have the problem. I found that my subreport was hidden ONLY it' s datasource was empty. That is, if any of the master records has details, the subreport shows for all the master record and is empty for the ones with no details.

I dont' t see the Suppress If Blank option...Only Visibily (Visible/Hidden/Expression).

By "turn off border" do you mean make it transparent? Mine is already and it seems the border width cannot be less than 1.

Thank you.

MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA)
 
First, you are in the wrong forum. In the future, use forum149 or forum767 for issues like this.

If you select the subreport->format subreport->borders, you can change the borders of the subreport to "none" instead of the default "single line". What version of CR are you using? In version 9 and above, there is an option in the subreport tab (format subreport->subreport tab) to "suppress blank subreport". This should be checked. Also in the section expert of the main report, select the section in which the sub is located->"suppress blank section".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top