In the age of paying for the weight of your recycling trash or kids trying to convince the Federal Government to change the font on all documents to save ink, I thought it was my time to offer up a solution that could save you and your company millions of dollars annually. Ok, maybe that is a little ambitious but read on!
With the desire to protect data as well as control printing of documents there is a very underutilized functionality in Microsoft SQL Reporting Services (SSRS) that actually allows you to control what gets ‘printed’ based on the rendering format. Once you get the hang of this you can use your imagination on the benefits. You could use it to redact information once it is printed or you could eliminate a graph or change the fonts based on rendering type.
I am going to take this scenario and show you how you can do it in SSRS.
SCENARIO: I have a report that when I view it on the screen I want to see the Number but when I print it I want to redact the Number so if the document falls into the wrong hands everything is fine. (Although that never happens)
Figure 1: Your current report layout
Step 1: Right Click on field and select Expression.
Step2: In the expression add this.
=iif(Globals!RenderFormat.IsInteractive, Fields!Number.Value, "XXXXXX")
Step 3: Completed.
When you run this on the screen you will see the full Number.Value (Figure 3) but when you run print this or export this you will see the following instead. (Figure 4)
This is not limited to just data. You could do this for images, colors, fonts, etc.
I have even seen people conditionally set titles, page numbers, etc so that when they export to excel it does not have the titles and other no important data. In which case you would use something like this.
=IIF(Globals!RenderFormat.Name = "EXCEL", True, False)
If you use something like this (above) you need to make sure you use the full name and case sensitive. You can find them here.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!