SSRS rdl Header and Footer Removal from specific pages - reporting-services

I want remove header and footer from specific pages e.g from 2nd 3rd page out of 5 pages because when we export it to excel sheet it will merge cells and the sorting of excel will not work on sheet 2nd and 3rd.

I don't believe there is a way to remove the header/footer region from certain pages of the report. The only options SSRS gives is Print on First Page/ Print on Last Page options in the Header properties, so you can only control the first or last page of the report with those options.
You can hide the elements inside of the header/footer regions through their visibility property. For example, you could hide the header/footer contents on pages 2 & 3 by setting the visibility function to the following for the items inside the header/footer regions:
=Switch(Globals!PageNumber < 2,false,Globals!PageNumber < 4, true, Globals!PageNumber >=4, false)
By hiding the contents in those regions, excel will have a very narrow empty row at the top of the page, but at least it won't create the funky merged cells.
If you want to completely eliminate headers when exporting to excel, you can do so by following the instructions in this article I wrote:
http://jaysonseaverbi.blogspot.com/2013/11/ssrs-exporting-options-for-excel.html

Jaysonseaver gives a good option. But, similarly, you could also do this by the Page Name. If you name your pages (such as for excel export the page name becomes the worksheet name), then the Page Name built in could also be quite useful.
Something like:
=IIF(Globals!PageName = "MyPageName", true, false)

Related

SSRS Adding fields in report headers/footers

I am wondering if there is a better way to have fields displayed in the report headers and footers. Currently we are doing this by adding the field to a tablix in the report body and referencing that in the header/footer
=ReportItems!ItemName.Value
This however means that there are a lot of hidden fields attached to the main tablix used in the report body and if the end user has to edit the report in the future for whatever reason then it is just confusing and complicated to navigate.
The reason that the fields displayed in the header and footer are attached to the main tablix used in the report body is so that we can take advantage of the grouping and page breaks set there so we can make the header update with different data across different pages within the same report
I know this way works and is probabily one of the easiest to implement but we have a lot of fields that need to be displayed in the headers/footers and the body of the report just looks a mess with lot's of tiny columns in the tablix all hidden. It also makes our tablix quite wide with all of the hidden rows that just make the report it self a lot wider than it should be .
Is this the correct way to do it or is there a better more intuitive way of displaying data in the headers or footers?
I can think of two other ways but normally in the header there should just be a title because its just a header. Everything else can go under the header and formated like you want it (with rectangles and page breaks for example).
So first of all you can use the page numbers to manage different headers. Put a textbox in the header and add the following expression:
=IIF(Globals!OverallPageNumber = 1, "This is the header for Page 1", "This is the header for Page 2")
You can also add a paramater to your report, where you manage different states to manage the headers. In the textbox goes something like:
=IIF(Parameters!HeaderParameter.Value = 1, "Sales haeder", "Work header")
The craziest I did was a header with two key informations:
="Sales Report " & CStr(Year(Now())) & " with an overall amount of " & Parameters!TotalsSales.Value & " EUR"
Everything else should go under the header I think. And if you need to display different tablixes with different information but each of them on a different page. You can add page breaks when you add a rectangle and go to Right click > Rectangle properties > General > Add a page break after.

SSRS-Handling different headers based on page number

Here is the similar imageI'm trying to create an SSRS report using SSRS 2008 R2.
I have a requirement to show different headers in different pages based on page number. For example, I need two textboxes to be shown in all the pages except page-1. So I put them in a rectangle inside report header and set the visibility(expression) based on pagenumber.
This works fine but it leaves a lot of white space in the first page header as it is hidden. How can I get rid of the whitespaces?
I tried putting those 2 textboxes out of the header, but I'm unable to hide them based on pagenumber, as the pagenumber global variable can be accessed only in header and footer but not from the body.
Is there any other approach to hide these textboxes on first page and show on all other pages?
Thanks in advance.
Update: added similar image
You can't recover the space in the header but you can not use it in the first place and let the text box grow when necessary. The bad part is that when it is exported to Excel, all the text will be in one cell.
Since your text is different sizes, you'll need to use HTML formatting.
In your regular header, add the page formula you are using with the TRUE part containing the text needed for your additional info and the FALSE part with an empty string - "". Use the <br> tag for a page break and the <font> tag to set the size.
="<b>This is My Page Header</b>" & IIF(Globals!PageNumber > 1, "<br><font size = '2'>Text Box 1" & "<br>" & "TextBox 2" & "<font>", "")
You'll need to set the Placeholder properties to Interpret HTML tags.

SSRS - RDLC Tablix Rows will not split across pages

I have a tablix with two columns of data (the section name and the section text). The section text has grown so large for some sections that the row representing the section takes up 2/3 or more of the page. THe report prints fine until on of these large rows would have to split over the end of a page and continue on the next page. In this case, and only in this case, the rows leaves large amounts of white space on current page and start on the next page (as if it had a page break before it)
I have already set the Tablix General Property "keep together on one page if possible" to true and all the other page break options for the tablix and row groups to false, to no avail.
Does anyone know of a trick or work around to make the large rows split over pages??
Setting Keep together on one page if possible to true/checked will cause SSRS to attempt to keep the row on one page, which means if the data spans across page breaks it will move that row to start on a new page so that it can be seen on one page, which would introduce white space where the row would be if the table was contiguous. So you need this setting set to False/Unchecked.
Next, ensure that the row group proeprty Keep together is set to False. This can't be accessed through the normal dialog box. If you don't have the properties pane showing in BIDS, then pressing F4 will bring this pane up. Select the row group(s), and ensure the property is appropriately set.
Also make sure that the text boxes inside the tablix are also set to KeepTogether=False. This will fix the problem.

Hiding one textbox in the table header when it is not in the first page

Help me please. This thing drive me crazy. It really should be a simple solution but I can't find it, even with Googling.
I have a subreport that display deposit transaction banking statement from account (customer).
This subreport will be accessed through main report that loop all accounts in one branch, so it's like a batch report processing for all customer in a branch. Rendered to pdf and distributed to all our branches.
Since I know that subreports header footer won't work on main report, I decide to move the subreport header into subreport table header and make it looks like it was a report header. But this is one problem I can't solve: there is address box that should only visible on first page for each customer, along with the other header that always visible.
And this will be printed on pre-printed paper, so I cant make the address box outside the other header since the report would be shrunk, without the address box, at page 2 and the rest of the pages from each customer, which will make the table header and the content go up and the positions will not match with our pre-printed paper borders anymore.
What am I supposed to do? Please help, I've been searching andn trying for 3 days and can't find any working solution.
Thanks.
I suggest:
Set the subreport table header row property RepeatOnNewPage to be True (in the Properties window).
Set the subreport table header cells Visibility>Hidden property for the address box cells to be a formula that evaluates to False for the first page, and True for all subsequent pages, such as:
If PageNumber = 1 Then False Else True
This should ensure that the table header is printed on every page, with a blank section the size of the address box included on all pages after the first page.
yes.
the address box is only at first page for each customer since it is for posting address. i cant tolerate address box in each pages of each customer because it would be very awkward.
and i have to maintain the space on page 2 onwards so the report don't collapse (header going up of the paper) and not match with our already-printed (already have company logo and borders) papers.

Reporting Services - Header Columns not showing?

I'm using Reporting Services 2008 and Report Builder 2.0. I've used a tablix to display my data in a simple way - essentially each row in the database receives a row in the tablix - nothing fancy. I have a header row with a name for each column. I also have a super-header which groups together a few of the columns into logical groups (e.g. basics, address related, etc.). Now when I generate the report everything looks beautiful - but if I page to the next page it doesn't show the headers. I've tried setting the Repeat Header Rows on Each Page but it doesn't seem to help?
In the Tablix properties check the boxes for: Repeat header rows on each page and Keep header visible while scrolling.
Make sure that the column headers check boxes are NOT checked.
In the Group pane on the left (Row Groups), the first line is static. Set the following for this first static only
set its: "ReapetOnNewPage" property to TRUE
set its: "FixedData" property to TRUE
set its: "KeepWithGroup" property to AFTER
It will work surely!
Source : Answer by ambk on this MSDN
I solved selected advanced next to row groups and column groups then it would show me the additional header rows. I could then select one of these header rows and change the property RepeatOnNewPage to True.
In your RDLC file, make sure that you have a Header node specified. It is possible that you are referring to your "Table" headers, which is not the same as the Report RDLC Header. The Report Header is the one that will repeat using the RepeatHeader property.