SSRS subreport instead of reportfooter - reporting-services

I am working on a report that has variable coulmns and the report looks fine in preview.
But now I want to add a "Hazardous Notice" like a report footer but via using subreport.
And this Notice will be only having TEXT in it (no columns and rows)
I am able to drag the subreport from the tools beneath my main Matrix, but I am really confused that how can I get only TEXT in that HAZARDOUS NOTICE.. as it asks me to add parameters in it. Do I need to create a Parameter for that or not.. Please Help!!!

Related

Page break from subreport is missing from exported PDF

I'm stuck with SQL 2014 because reasons. I have a subreport with this structure:
The intention is to have a page break before each table of parts destined for the same warehouse. This works perfectly when I view the report in Report Builder or SSRS. But when I export to PDF, the break before the first warehouse is missing, as if I had selected BreakLocation "Between" instead of "Start."
Is this a known issue? What's the workaround?
I stumbled upon a workaround. I added a tiny row at the top of the subreport table, outside the group. The row simply contains an empty textbox. The row must not be hidden, but the textbox can be, so you could add some text to explain why it's there.
The rule seems to be that if the very first thing in a subreport is a page break, it will be discarded. But why this only affects PDF export remains a mystery.

How to do SSRS Document Map bookmarking for subreports

I have a SSRS solution with several subreports in one report. Client needs bookmark(in PDF) for each subreport as shown below.
Left section shows SSRS design page with textboxes and subreports stacked . Right side shows the result we need to achieve.
I tried the below link to set DocumentMap. But could find a solution how to apply this for subreports.
https://www.mssqltips.com/sqlservertip/3504/sql-server-reporting-services-bookmarks-and-document-maps/
Any help on this is greatly appreciated.
If you just need a map entry to point to your subreport then you can set this by simply clicking on the subreport from your main report and setting the DocumentMapLabel property
If you need your document map to point to specific parts of your subreport that requires a bit more effort but still pretty simple. You have to setup a document map within the subreport. This will then be nested in the main report's document map.

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 report - show tablix only once

I am using SSRS report (VS 2010) and 'tablix' object.
I need showing the tablix only once in the report (it is used only once for the first page, or for the last page, or whenever I like to).
(I have thought to add a variable, and set it while doing the report (like a flag), and check that flag, but I don't know how doing that, and whether there is better way).
How can I show the tablix only once?
Thanks :)
As the link: https://msdn.microsoft.com/en-us/library/dd220592.aspx, table is a preffered way to create some 'fixed' elements in SSRS.
You can use header for fixed elements and body for the variables length.
Nevertheless in the body you can declare a subquery and do any design desired.

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.