Wednesday, November 23, 2016

Hiding extra export options in SSRS 2012 Reportviewer for SharePoint

In SSRS 2012, reportviewer provides multiple export options including pdf, word, excel, mhtml etc.
Different customer may have different requirement to have the specific export options.
Our client wanted to have only excel and pdf to be visible in the available options.
Its simple but somewhat changed from the way we do in SSRS 2008.

Use below powershell to hide all the options except pdf and excel.

$SSRSApp = Get-SPRSServiceApplication
if ($SSRSApp -ne $null)
{
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "XML" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "MHTML" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "CSV" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "IMAGE" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "HTML4.0" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "RPL" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "WORD" -ExtensionAttributes "<Visible>False</Visible>"
   Set-SPRSExtension -identity $SSRSApp -ExtensionType "Render" -name "WORDOPENXML" -ExtensionAttributes "<Visible>False</Visible>"
}

update the above script based on what options needs to be hidden and what options needs to be kept visible to user.


No comments:

Post a Comment