1
votes

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

1
Have you tried putting your textbox in a Rectangle and using the rectangles visibility? I think the space will be recovered when a rectangle is hidden but not a text box or row. How big is your text box? I would make it small and let the height grow if needed.Hannover Fist
Can you show us a picture of the report header to see how these textboxes are positioned?Kim
I tried using rectange but it didn't help. The two textboxes are one below the other. I have a general page header which needs to be displayed on all the pages, but I need these two textboxes to be displayed just below the main header on all other pages (except page1). I tried using these textboxes in a tablix on the body and setting the row visibility, but the global variable of page number does not allow me to access it on the body. I also tried custom code to increment page number, but even that didn't help.Rajashekar V
@HannoverFist I have added a similar image to the question above.. Could you take a look and suggest any approach?Rajashekar V

1 Answers

0
votes

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.

enter image description here