65.9K
CodeProject is changing. Read more.
Home

SSRS - Report Viewer - Hide PDF Export option

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.83/5 (4 votes)

Nov 8, 2011

CPOL
viewsIcon

41823

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.

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

Enable the 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 to restart your Report Server.

Conclusion

This can be applied to other exporting options too.

Read More...