SSRS show the same objects in the second page - reporting-services

I have a Report in SSRS that displays some logos at the top of the first page. I just got a requirement to add the possibility to also show the logos in the second page -- The report is only two pages. Is there a way to repeat the same Image objects in the second page?

If your report is specifically laid out to span multiple pages, you can use a repeating page header. If not (i.e., the second page is caused by content overflow), and you know it will always be two pages or less, you can use a page header and select "print on first page" and "print on last page" in report properties. Otherwise, if you have tablix controls causing the page span, and your page design allows, you can put the logos in the tablix header and enable repeat header on all pages for the tablix. If none of those work, you'll be stuck, as far as I know.
See also this question.

If you are showing Image in the header then you need to following things:
Adding a Data-Bound Image to a Header or Footer
You can use image data stored in a database in a header or footer. However, you cannot reference database fields from the Image report item directly. Instead, you must add a text box in the body of the report and then set the text box to the data field that contains the image (note that the value must be base64 encoded). You can hide the text box in the body of the report to avoid showing the base64-encoded image. Then, you can reference the value of the hidden text box from the Image report item in the page header or footer.
For example, suppose you have a report that consists of product information pages. In the header of each page, you want to display a photograph of the product. To print a stored image in the report header, define a hidden text box named TXT_Photo in the body of the report that retrieves the image from the database and use an expression to give it a value:
=Convert.ToBase64String(Fields!Photo.Value)
In the header, add an Image report item which uses the TXT_Photo text box, decoded to show the image:
=Convert.FromBase64String(ReportItems!TXT_Photo.Value)
http://technet.microsoft.com/en-us/library/dd220421(v=sql.105).aspx
TO repeat image on every page
IN addition to this, to repeat this image into everyt page, Go to property of TXT_Photo textbox In General tab, tick the check box "Repeat report item with data region on every page" and select your region.
Thanks

Related

Is there a way to make a rectangle not appear in the first page in ssrs?

I am creating a report on ssrs.
I have a rectangle with a textbox inside of it, that I want to hide on the first page. This is because I have another description of the item, with an image next to it, that only appears in the first page. Below this there is a tablix with details of the item, it can contain a variable number of rows.
The problem is I'm not able to hide the rectangle with the textbox in the first page only. I tried using global variables like PageNumber but you can't use it in the report body ( I tried many workarounds for this but none worked). I also can't just place the two rectangles I need to show on the report header because that only shows the first item (can't link it to dataset).
So what I'm asking is how to hide the rectangle? In the Image I linked the rectangle I want to hide on the first page is the grey one and the one that only shows in the first page is the pink one.
Thank you for you replies.

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.

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.

How to keep List contents on the first page? (SSRS 2005 - PDF Export)

I've got the following report setup:
1. Letterhead (not in the header, since i only want it on the first page)
2. List control with some data
when i export the report to PDF, and the contents of the List are less that one full page - my letterhead is displayed on the first page (the rest of the page is empty) and the List content gets moved to the second page.
if the List grows over 1 page - reports is showing up just fine (Letterhead and portion of the list on the first page - the rest on the second page)
It looks like it tries to keep the list on 1 page as long as its contents fit on the page - but when you add the letterhead to the contents it overflows the page, and the list gets bumped down to the next page.
Is there any way to keep the list on the first page regardless of its size.
Putting the letterhead in the list is my last resort, I'd like to hear some other solutions.
uploaded a sample .rdl to illustrate the problem
got rid of the list for simplicity, the problem seems to be with a textbox wanting to show up on 1 page
p.s. see this question for more details
What is the source of your text? Is it coming from a dataset? If so, Add a paragraph id in it, set your table to group on the paragraph id and show only the group header. In the group, add a bottom padding value of say 5. The table will handle the paragraph breaks for you, and if it grows more the a page it will handle it for you. Make sure that keep together is set to false. The paragraph id will be used to sort the dataset by id ascending.
sorry I didn't notice your comment at the end. The only other thing that i can think of is to shift your list up closer to the header and eliminate all empty space at the end. Also, make sure the KeepTogether option in the list is set to false. This way it will break up your list rather than move it to the next page.
you can put both the letterhead and the list inside a rectangle so they are always grouped together.
Reporting services also tries to keep the relative spaces you have in the designer, so if you list is aligned to the bottom of the page and there is a space form the header; it will keep the space on top and align everything to the bottom of the page.