SSRS SubReport - Set to Not Grow, but it continues to grow - reporting-services

I am building out a report that contains a Sub Report, I need that Sub Report to be a static size. I've researched and read that you can place it in a tabix and set the row CanGrow to False. However, as soon as I put the sub report in the row, the tablix automatically resets CanGrow to True.
What am I doing wrong? How do I get around this? Any help would be greatly appreciated as I am at a loss right now and can't seem to figure it out.

You can't prevent it from showing the whole subreport. But, you can pass the subreport a parameter. And that parameter could be a flag that controls how much of it is visibile. So, when the subreport is viewed from the main one, you could have it cut off where you want. Then when it's viewed by itself have that parameter default to show everything.

Related

ssrs subreport page break not working

The ssrs subreport page break is not working.
How can I get ssrs sub report page break ? Thanks.
i.e. Reports -> properties -> pagebreak is not working.
I usually put a subreport in a Rectangle and let the rectangle control the page break.
I'm not sure where you want to put your page break. Judging by your picture and arrow, it seems you're concerned with keeping the data of one subreport together without breaking.
This would be the KeepTogether property of the subreport object. Set it to TRUE so it will add a page break rather than break up a subreport instance.

How to Visible Group Header While Scrolling in Tablix Report

While working with Tablix Report I want to visible Group header while scrolling
I tried Fixed Data = True but not working for me. BTW, First header row is working fine by changes of show scroll bar. (FixedData property to True in Advanced Mode) but not the this one row.
Kindly provide me the solution.
In SSRS 2008 R2, I managed a workaround using subreports.
Make a report that shows the data for a single group, based on a parameter.
Put all the headers you want on this report's tablix, and make them fixed with FixedData = True.
Use the parameter to set what will appear in the group-specific header text.
Make a separate report that will get every group.
Create a table grouped by your group, with one cell.
Put a Subreport in the cell, and pass the group to the subreport's parameter.
This worked for me in the Visual Studio preview, and viewing a deployed version on IE and Chrome, and hopefully will work in your environment too.
The catch is you'll see the main report header repeated for each group. However I tried to add this to the main report and it seemed to confuse matters, functioning differently in preview, IE and Chrome.

Referring to ReportItem properties in SSRS

In an SSRS report expression, is there any way to refer to the "Hidden" property of a ReportItem?
More specifically: my SSRS report consists of a summary, with a subreport containing detail. I'd like to be able to stop the subreport running if it's hidden, as in this question. The answer to that question recommends changing the query based on a parameter, but my problem is how to set that parameter. Actually, I only need the parameter to be 1 or 0; the query will just return nothing if it's 0, and that's good enough.
I'd like to be able to show or hide the subreport using a textbox as a ToggleItem, and have an expression as the parameter value that goes something like this:
=iif(ReportItems!SubReport1.Hidden=False, 1, 0)
...or this:
=iif(ReportItems("SubReport1").Hidden=0, 1, 0)
...but the "Hidden" property doesn't appear for either.
Other options I've explored:
Putting in an invisible text box, and using its value in the parameter expression as per this MSDN article. The problem then becomes how to set the value of the text box.
Using a variable; same problem applies (actually I'm not even sure how you use variable in SSRS, or even if you can).
Keeping the subreport as a separate report, and linking to it; a bit inelegant, and means losing the other report content when the user wants to see the detail.
Extensive Googling; returns a lot of ways to set the "hidden" property, but no way to reference it.
Suggestions, moral support, constructive criticism and barefisted abuse all gratefully received.
As the answer here stated, you can't stop a hidden item from running. If you don't want the subreport to run when you render the main report, you'd need to run the main report with this variable that prevents it from running in the first place.
To this end, it would make sense to simple hide or show this subreport by using the parameter, rather than a textbox toggle. You can reference the parameter's value for this on the subreport by using:
Visibility -> 'Show or Hide Based on an Expression' -> f(x)
IIF(Parameters!ToggleSub.Value = 1, true, false)
The thing is, if you included a textbox to toggle the visibility at this point, the only way to do it would be to pass back a parameter and refresh the report anyway. Once you choose not to render the subreport, it will only render if the entire report is refreshed.
I hope this helps you out.
The question you linked above shows how to use a report parameter to control the visibility and execution of subreports. But that's different from using a report item such as a text box to do it.
It sounds like what you're really looking for is on-demand execution of subreports, which I'm afraid isn't possible. The report rendering only happens once when the report is first displayed unless you change parameters and run it again.
I'm afraid your only option for on-demand execution of the detail report is to use a "drill-through" design. That means text boxes on your report that serve as links to the detail report instead of the detail report being used as a subreport.
SSRS 2008 R2 Drill Down On-Demand to Sub Report

SSRS - Page Break - Subreport

I have a report with two subreports inside. The main report has keeptogether true and page break checked in a group. Both subreports has keeptogether false and no page break.
My environment is SSRS 2008 and VS 2013 (Reportviewer 11)
I got two (separate) issues:
the page break is not working when I display the reports in reportviewer in browser. But it works when I export it into pdf.
if the main+subreports cannot fit to one page. then it basically cut the main report and subreport into different page (even though
keeptogether in mainreport is true and subreport is false)
Is there someone that can suggest what is going on? Some post stated that this is a default behaviour, if yes, is there any workaround for this?
Thanks before!
The default DisplayMode of the ReportViewer is set on Normal, try changing this to PrintLayout.
myReportViewer.SetDisplayMode(DisplayMode.PrintLayout);
When the report content exceeds the maximum page size it will break to a new page, there is no way of stopping this, in the designer the property even says "Keep together on one page if possible".
As your description of your actual report isn't completely clear, I'll assume that your main report has some data above the two subreports that you wish to be kept together.
To achieve this wrap that data inside a new Rectangle and set the KeepTogether property on True.
If I misunderstood you in anyway, just let me know and i'll update my answer.

Subreports try and keep together leaving blank spots/pages

Reporting Services 2005
My layout is like this:
I have the mainreport which contains a table
This table has 3 groups it runs by, GrpLevel1, GrpLevel2, GrpLevel3
Sub-Reports are added to one of 3 groups and are executed passing that group key to the sub-report
So, a particular sub-report will run at GrpLevel1 and for every level2 it contains, the sub-reports under GrpLevel2 will run.
The problems I'm having are that the sub-reports want to jump to the next page leaving a gapping hole of white-space in the report.
If a sub-report contains a table with a bunch of data and it can not fit on 3/4s of a page (first page on report has report header on top 1/4), it will jump the whole thing to the next page leaving only a header, rather than printing what it can on the first page.
On the table I have "Keep Together" turned off.
I'm at a loss and about ready to set my cube on fire. Insight in to this would be greatly appreciated.
UPDATE ****************THIS HAS BEEN FIXED IN SSRS 2008 R2***********************
It has been fixed with (SQL Server) Reporting Services 2008 R2. You can now toggle the KeepTogether on Sub-Reports. Pagination looks a lot better.
Looks like there is no solution to this problem. The bug is aknowleged by microsoft, but its still not fixed in SSRS2008.
From the KB article (http://support.microsoft.com/kb/938943)
This behavior occurs because the
Subreport control has an implicit
KeepTogether property. By design, the
KeepTogether property tries to keep
content of a subreport on one page.
Because of this behavior, the report
engine creates blank space on the main
report if the subreport does not fit
on the same page as the main report.
Then, the report engine creates the
subreport on a new page.
The work around that they list is essentially 'don't use subreports'
I am not sure about the earlier version of SSRS, but I faced this same issue in SSRS 2008.
The solution is to change the Subreport property in Code.
Go to the solution explorer, right click on your report and click on "View Code".
Search for your Subreport.
Inside subreport tag you'll find "<KeepTogether>", which would be set to "true", change it to "false"
This property is not avaiable from designer and has to be changed from the actual report xml code.
right click of subreport and chose format subreport, then uncheck keep object together
Another way I got around this was to place the subreport in the report header. Of course that is very dependent on the report content and elminates any of the usefulness of subsequent sections but it did solve my problem of having a huge chunk of whitespace on the first page.
It took me a week to solve this one! But I did find a solution and happy to share it with you.
I had the exact same problem. In my main report, there is a Table that has 3 groups and 2 different subreports in each group. And these subreports had matrices. I believe regardless of matrices, subreports being placed inside group/detail bands within a table caused alot of unnecessary blank pages to be printed before, in between and after the sections. It was a pain the neck and I was thinking of removing the subreports but then it defeats the whole purpose of the report.
So finally, what fixed it was instead of placing the subreport in DETAIL bands of the groups in the table, place them in the Footer of the groups. Now I know this may change/affect the format of the report and may not fit in with your report purposes. But this fixed the issue for me. Another way of getting around the blank page issue was leaving the subreports wherever they are (detail or group bands), and moving OTHER detail bands into one Footer band. Essentially what needs to be kept in mind, is to reduce the number of detail/group bands inside the table. Limit the groupings and have minimum number of subreports within a table if you can manage that.
Hope this helps someone out there.
For SSRS 2008
If your subreports are in any group, you should go to group properties and switch the keep together property for that group(s) to false. This worked for me.