Downloading an SSRS report in Excel and PDF
This recipe shows how to download an SSRS report in Excel and PDF format.
Getting ready
To perform this recipe, you must first download and install the ReportViewer
control. The ReportViewer
control allows SSRS reports to be displayed and viewed to a web or Windows form.
Note
See the Using ReportViewer to view your SSRS report recipe on how and where to download the ReportViewer
control.
After installing the ReportViewer
control, select a report that you wish to download into an Excel or PDF version.
In this recipe, we will download a report /Customers/Customer Contact Numbers
into Excel and PDF. Alternatively, choose a report you wish to download and replace the $reportViewer.ServerReport.ReportPath
variable.
How to do it...
Let's explore the code required to view your report in Excel and PDF.
Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
Load the
ReportViewer
assembly:Add-Type -AssemblyName...