Hi Everyone,
Our client has expressed interest in modifying the PDF layout of a particular report. Specifically, they want the original report to maintain its current background but prefer the PDF version to have a blank background.
Is it possible to exert this level of control over the printout layout using Paginated Report Builder?
Any guidance or insights on this would be greatly appreciated.
Thank you for your assistance,
Roberto
Hi @Roberto
I donât use report builder so not 100% on this, however I used SSRS for years and believe theyâre essentially the same (a bug which used to crash SSRS seems to still exist in RB which is quite amusing). It worked in my testing but not sure when used properly!
On the background properties, select expression:
![image](https://forum.enterprisedna.co/uploads/db7134/original/3X/8/4/84cf65d358107e2a6a2aebc6e06f26b4fa6a5961.png)
Then enter the following, changing the colours as you need:
=if(Globals!RenderFormat.Name = âPDFâ,âRedâ,âGreenâ)
The above will render as green when you view it, but red when exported as a PDF.
Thanks,
1 Like
That is true for the Background Fill Color; however, I read the question as referring to âmaintain its current background but prefer the PDF version to have a blank backgroundâ, and without a screenshot of the report, I thought the question referred to a BackgroundImage rather than Background Fill Color.
Would the general idea of using a simpler IFF expression using âRPLâ as the parameter instead of âPDFâ to show BackgroundImage when rendered in Report Server and hide it when exported such as:
=IIF(Globals!RenderFormat.Name = âRPLâ, true, false)
This assumes the logic not to add a BackgroundImage to any exported report files.
Would the expression need to change depending on the BackgroundImage source (External, Database, Embedded)?
I donât have a way to test this, however.
1 Like
Hi @ystroman,
Iâve also used what you proposed and it works.
I was unware of the Global variable and they actually let to manage all (so far for me) the aspects of UI and printouts.
Thanks for your help
Roberto
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/built-in-collections-built-in-globals-and-users-references-report-builder?view=sql-server-ver16&redirectedfrom=MSDN