Put subreport with paging in footer - reporting-services

We have about 100 different reports. All of them have the same footer, which contains a Page Number, and maybe some other text. The footer design may change regularly.
So now, for exmaple, if we want to change the footer from "Page 1 of 5" to "P. 1/5", this has to be done for each report, i.e. 100 times.
I would like to be able to put a Subreport in the footer instead, and then only one change will be needed. However, SSRS won't let you insert a Subreport in the footer (CrystalReports let's you do that).
What can be done?

If you're using SQL Server 2008 R2 and Report Builder, you could create your footer details inside a rectangle and publish that rectangle as a Report Part. You would then just need to open reports in Report Builder and run a "Check for Updates" to update the footer.

Related

Subreport as a header in main report (with page numbering)

I'm facing an odd issue: I'm going to create lots of reports using reporting services (SSRS) and one request was to create a subreport that will be shown as a header in main report. I've come across two main problems:
It is not possible to insert subreports into report headers. I thought of a possible workaround and just create a subreport without header and then insert subreport on top of body in main report. But then I faced another problem:
My header contains a logo, title and page number. However, function for page numbering cannot be used in report body, only in header.
Is there any alternative? Or should i just add a header to each report instead of trying to create a subreport for the header?
You can start by using a report with the header as a template. You would start with this whenever you make a new report. That at least eliminates the need to recreate it each time.
If you do want to be able to manage the headers dynamically, you can use a data-driven approach. Almost all of the properties for images and text boxes can be defined with expressions. And the expressions can refer to a dataset. In other words, you can store all of your preferences in a table. Your header template would include a dataset that brings in all the settings. Then you can use expressions to define how the header will look.
By doing this, you would be able to adjust the image, font size, etc. in all the headers at once just by changing a value in your table. Obviously there is some overhead with setting up the template this way, but it has a negligible performance impact and gives you more power to manage the header dynamically.

Adjusting subreport headers in SSRS

I'm trying to create a sort of master subreport that I can use as a header for other reports.
The subreport has 2 image logos in the left and right corner. I insterted the images in the body of the subreport.
My struggle here is to make it as universal that it works with all reports.
Some of the destination reports even though they are all A4 size reports, have different size report bodies. For example, the destination report is a bit more narrow than the subreport with header, in the preview I end up with a wider header than destination report body, the header clearly takes the width from the header subreport. Is there a setting or a way that I could set the width of the subreport header to fit to the destination report width?
The only possible workaround currently I can think of is to play with the margins etc in each of the destination reports
Easy way to handle this: Use an internal parameter that defaults to false to toggle the visibility of elements like title blocks and images.
When including the report as a subreport, set that parameter to true and you'll have a stripped down data-element only version. Then put titles and other formatted layout around the subreport in your master report. That way you can make everything line up there.

SSRS subreport instead of reportfooter

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!!!

Report Footer On ReportViewer

It ´s a real pleassure to be part of this great community.
My questions it's that.. How can a I set a Report Footer (Information that just appear on the last page of the report ) in reportViewer?.
cause when I set Page footer it appear on every single page of my report, but I need the information only once, on the last page of the report.
VisualStudio TeamSystem 2008.
C#
windows XP Profesional SP3
Thanks.
you can insert a rectangle to your report footer and put all of your footer to that. after that write an expression for its visibility. you should use
Globals!PageNumber and Globals!TotalPages for this. if this two property equals then you set visibility to true.
You can also turn your footer text to an expresion like this
=IIf(Globals!PageNumber<>Globals!TotalPages,"","My footer text")

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.