SSRS reports - different watermarks on different pages

Is there anyway in SQL Server Report Builder (through an expression or code) that I could apply a watermark to page 1 and a different watermark onto page 2?

Thanks
Seven0fNineAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Nico BontenbalCommented:
Yes that is possible. You can use an expression for the BackgrondImage property of the report. The problem is that you can't use the PageNumber global in this expression. That global can only be used in page headers and footers. So you need another way to check if you are on the first page. In the example I've attached to this post you can see that it is possible. But I'm using two different Rectangles on the report. So this report has kind of a 'cover page'. But I don't know if you can design your report like that.
I'm using a report variable to control the background image that is used. For more information see: https://msdn.microsoft.com/en-us/library/dd255208(v=sql.105).aspx
Maybe it is possible to have a control in the page header that sets the value of the report variable based on the page number. I think that's worth a try.
And here is a post that explains how to control the background image by using the background of a rectangle. This technique might work for you (use ROWNUMBER("DataSet1")=1  in the expression): https://social.msdn.microsoft.com/forums/sqlserver/en-US/fc0d1b4c-d426-4a76-9d03-7155849c4d43/conditional-background-image
Watermark.rdl
0
 
Seven0fNineAuthor Commented:
Many thanks for your solution and the sample, much appreciated! I have the images working on different pages. It seems that if on my rdl only page one is populated with group text, then page 2 is also generated (only showing the image). I'm getting the feeling from reading lots of other forums that to hide the image on page 2 is quite difficult (due to limitations of rdl's) a global pagetotal cannot be used in the body of a report.....?...

My report consists of having client info in the top half of page one, and the bottom half is (grouped) billing info, so x number of rows could be returned. I know that 12 rows would fit into the bottom half of page 1 and to hide the image on page 2 I'm using =iif(Rowcount <=12 show page1image else show page2image). The problem is that some of the billing info rows can contain up to 20 lines, so if a few large multilined rows are returned, this would say only allow 3 rows on page 1 and the rest on page 2, but using my expression of '12' will no longer show the image on page 2 when it is needed.

- Is there a way to reference page numbers in the report body?
OR
- Is there a way to determine in a group what rownumber the break line has occurred on?
OR
- is there a way to  determine what page a textbox control is on?

Many thanks for your assistance
0
 
Nico BontenbalCommented:
Maybe you can use the technique in my updated example. Here I set the Firstpage variable in the header based on the page number.
There is one problem with this technique, when you go back to the first page the background of the other pages is shown. But if you use your report to create pdf's for example that might not be a big problem.

You probably want to hide the page header, but then it might not work anymore. I think you need to have a visible control on a visible page header. But instead of a value you can display an empty string in the control. And you can make both the control and the header as small as possible.
Watermark.rdl
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
Seven0fNineAuthor Commented:
Thanks for your detailed explanations, what I'm trying to achieve is something that cannot be done in report build, too much limitation within the product. Enjoy the points!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.