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

SQL Reporting services hiding blank subreports

Status
Not open for further replies.

Linda224

Programmer
Dec 6, 2006
80
US
Hello
This is an issue with sql reporting services
I have posted it in that forum but no one has replied. I was hoping someone here might have a suggestion.

I have a report that has about 35 subreports in it.
The report can return all subreports or just one. This works but when the say 25th subreport is selected there are 24 spaces above it where the other subreports are.

Does any one have a suggestion on how to hide the subreport completely?

The subreports are in rectangles and i think it is the rectangles that are still there when the sub report is blank.

So I think I am trying to hide the rectangle when the sub report is empty

Thank you
 
Why do you need a rectangle? Why not just put a border around the subreport itself, within the subreport's designer (not in the parent report's designer).
 
So far putting it in a rectangle is the only way I can get it to page break after each report.
I need all sub reports to show up on their own page so when it exports to excel they are on separate sheets.

How do I put a border around it?
 
Well if you're not using the rectangle to simply create a box around the subreport like I was assuming, then border will not help.

Did you also apply your Show/Hide logic you use for the individual subreports to the individual rectangles?
 
I cant get show hide logic to work right

I took the rectangles out of the main report and put them in the sub report. Now instead of a blank space where the sub report is I get an entire blank page.

How do I make the show hide work.
I tried putting it in the rectangle but i dont think i am doing it right
 
There is a Hidden property on most report objects. You can set these to an expression. For example, if you have a parameter to allow the user to choose which subreport to show, then your Hidden property for an example SubReport1 would look like the following:
Code:
=Iif(Parameters!rpSubReport.Value = "SubReport1", False, True)

This basically says, "If the user has chosen SubReport1 from the drop down, do not hide the particular SubReport. Otherwise, hide it.
 
ok so this works
=IIF(IsNothing("subreport1"),True,False)
to hide it when the subreport is empty but the page break at end doesnt work when this is there
:(
 
Linda, did you ever find a solution to this issue? I have a related problem.
 
Why not just put in a tablix with no data source, and in each row, have a subreport.

Then you can force a new page for each row, also, there is a hide if no data option for subreport, if it's in a table row, you can hide the row if no data as well, which should give you what you want.

If memory serves, it will require a bit of fiddling to get it right though...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top