Tuesday, November 8, 2011

SSRS - Report Viewer - Hide PDF Export option

SQL Server Reporting Services eases designing of reports, whereas Microsoft Report Viewer control is used to display .rdl/.rdlc report into ASP.Net website.

Moreover report viewer control provides the various options in its toolbar. Of the different options, one option provides functionality of Exporting the report in different formats (like XML, CSV, Word, Excel, PDF ...)

Now what if one wants to exclude any/all of the above options?

Say if I want to hide PDF export option from Report Viewer toolbar. Below are the steps to do so.

Step - 1
Locate the file name "RSReportDesigner.config" at
"Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSReportDesigner.config".

Note: Location of the file varies in different version of SQL Server.

Step - 2
Disable PDF export option - add the visible attribute with value false
<Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering" Visible="false" />


Enable PDF export option - remove the visible attribute
<Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering" />


Step - 3
After this you need RESTART your Report Server.

This can be applied to other exporting options too.



Learn by diving in Programming Ocean...
Happy Programming!!!

No comments:

Post a Comment

Post a Comment