First published on MSDN on Jul 07, 2017
Hello Everyone, in this blog I am going to discuss about an interesting scenario while working on a customer issue recently related to Client Printing of SSRS Reports.
Let’s say you want to disable Client Side Printing on Reporting Services when you open your reports through your application on Internet Explorer. You use Report Viewer Control to view the reports on the client application. There is a setting in SQL Server Management Studio where you can toggle the parameter for
. We connect to the Report Server through SSMS - > Right – click on the name of the Report Server - > Advanced - > EnableClientPrinting - > You can choose this to be True or False. I have given a screenshot of the same below –
But the above setting is only for the SSRS / Report Manager application and does not affect Report Viewer Control which is a different entity altogether. You have disabled this setting in the above properties and expect the same setting to be applied for Report Viewer and you do not want to update your application code every time you enable or disable this setting.
To change the setting of the Print Icon in Report Viewer automatically, you can use this code snippet in your application code.
// Depending on the value configure at the Server Level, Report Viewer will be updated
if (newReportServerProperties.Value == "False")
ReportViewer1.ShowPrintButton = false;
ReportViewer1.ShowPrintButton = true;
// Refreshes the Report
This is the easiest way to dynamically enable or disable the report printing option on the client side as set in the report server property.
Any Sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. ANY SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANT ABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Author: Anshu Jana – Support Engineer, SQL Server BI Developer team, Microsoft
Escalation Engineer, SQL Server BI Developer team, Microsoft