SSRS provides a huge amount of rendering types. So far so good, but if you want to render the same report definition as HTML and let’s say as a PDF file you’ll maybe have a goal conflict. HTML does not care about page sizes and breaks, documents like PDF’s do. If your report has too many columns to put them on one page there may be some different approches:
Approach 1 and 2 are easy and not worth to write about. The “hide column” approach is a bit more interesting.
Select the header of the column you want to hide, right-click and select “Column Visibility…”. In the dialog that pops up, select “Hide”, render your report and you’ll notice that your column disappeard.
After that initial check, you could switch over to “Show or hide based on an expression” where you could define your own expression. One common approach is to hide data in non-interactive (see table below) render types. There’s a global variable called Globals!RenderFormat.IsInteractive for this purpose. Use this as expression:
If this isn’t detailed enough, use the global variable Globals!RenderFormat.Name to determine the visibility through the name of the rendering type:
=Iif(Globals!RenderFormat.Name = "PDF", True, False)
Here’s a complete list describing which render types are interactive:
|SSDT Preview /
|XML file with report data||XML||False|
|CSV (comma delimited)||CSV||False|
|TIFF file /
SSDT Preview > Print-Button
|MHTML (web archive)||MHTML||True|