Avatar of Seven0fNine
Seven0fNine
 asked on

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
SSRSDB Reporting Tools

Avatar of undefined
Last Comment
Seven0fNine

8/22/2022 - Mon
Nico Bontenbal

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
Seven0fNine

ASKER
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
ASKER CERTIFIED SOLUTION
Nico Bontenbal

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Seven0fNine

ASKER
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!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy