Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

SSRS - Report Viewer - Hide PDF Export option

2.83/5 (4 votes)
13 Nov 2011CPOL 41.8K  
How to hide PDF Export option in Report Viewer

Introduction


SQL Server Reporting Services eases designing of reports, whereas the Microsoft Report Viewer control is used to display .rdl/.rdlc reports in an ASP.NET website.


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


Now what if you want to exclude any/all of the above options?


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


Solution


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 the PDF export option - add the visible attribute with value false.


XML
<extension name="PDF" 
  type="Microsoft.ReportingServices.Rendering.ImageRenderer.
        PDFRenderer,Microsoft.ReportingServices.ImageRendering" 
   visible="false" />

Enable the PDF export option - remove the visible attribute.


XML
<extension name="PDF" 
  type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,
        Microsoft.ReportingServices.ImageRendering" />

Step - 3


After this, you need to restart your Report Server.


Conclusion


This can be applied to other exporting options too.


Read More...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)