啟用和停用 Reporting Services 的用戶端列印功能Enable and Disable Client-Side Printing for Reporting Services

報表檢視器工具列上的 [列印] 按鈕使用可攜式文件格式 (PDF),提供用戶端在瀏覽器中檢視之 Reporting ServicesReporting Services 報表的列印。The print button on the report viewer toolbar uses the Portable Document Format (PDF) format for client-side printing of Reporting ServicesReporting Services reports viewed in a browser. 新的遠端列印體驗使用包含 Reporting ServicesReporting Services的 PDF 轉譯延伸模組,以將報表轉譯為 PDF 模式。The new remote printing experience uses the PDF rendering extension that is included with Reporting ServicesReporting Services, to render the report in PDF format. 您可以下載 .PDF 格式的報表,或如果您已安裝可檢視 .PDF 檔案的應用程式,列印按鈕會顯示列印對話方塊,提供頁面常用設定項目,例如頁面大小方向及 .PDF 檔案的預覽。You can download a .PDF form of the report or if you have an application installed for viewing .PDF files, the print button displays a print dialog box for page common configuration items such as page size an orientation and a preview of the .PDF file. 雖然依預設會啟用用戶端列印,但如果您不想提供此功能,也可以停用它。Although client-side printing is enabled by default, you can disable the feature to prevent it from being used.

舊版的 Reporting ServicesReporting Services 使用 ActiveX 控制項,它必須從報表伺服器下載至用戶端電腦。Previous versions of Reporting ServicesReporting Services used an ActiveX control that required downloading to the client computer from the report server. 如果您將報表伺服器升級至 SQL Server 2016 或更新版本,列印控制項不會從報表伺服器或用戶端電腦移除。If you upgrade your report server to SQL Server 2016 or later, the print control is not removed from the report server or client computers.

列印體驗The Print Experience

當您按一下報表檢視器工具列上的 [列印] htmlviewer_print 按鈕,其體驗會依用戶端電腦上安裝的 .PDF 檢視應用程式及正在使用的瀏覽器而有所不同。When you click the print htmlviewer_print button on the report viewer toolbar, the experience varies depending on what .PDF viewing applications are installed on the client computer and what browser you are using. 您可以下載 PDF 檔案,或從對話方塊設定列印選項,取決於用戶端電腦。You can download the PDF file or configure print options from a dialog, or both, depending on the client computer.

報表工具列Report toolbar

第一個對話方塊在所有瀏覽器中都相同,並且允許您變更基本版面配置屬性,例如方向。The first dialog is the same for all browsers and allows you change basic layout properties such as orientation. 當您按一下 [列印] ,其體驗會依您使用的瀏覽器而稍有不同。When you click Print, the experience will be slightly different depending on the browser you are using. ssrs_pdfprint_chrome1ssrs_pdfprint_chrome1
在 Chrome 中,會開啟詳細的瀏覽器列印對話方塊。In Chrome, a detailed browser print dialog opens. 您可以變更列印設定、列印和開啟作業系統列印對話方塊。You can change the print configuration, print, and open the operating systems print dialog. ssrs_pdfprint_chrome2 ssrs_pdfprint_chrome3.pngssrs_pdfprint_chrome2 ssrs_pdfprint_chrome3.png
如果您已安裝 PDF 閱讀程式應用程式,列印按鈕將會開啟 PDF 檔案的預覽視窗,您可以儲存或列印。If you have a PDF reader application installed, the print button will open a preview windows of the PDF file and you can save or print.
如果您沒有安裝 PDF 閱讀程式應用程式,則會有兩種使用者體驗:If you do not have a PDF reader application installed, there are two user experiences:

報表將自動轉譯,並使用您的瀏覽器下載程序下載 PDF 檔案。The report will automatically render and use your browsers download process to download the PDF file. 注意: 報表越複雜,則您按下 [列印] 到您看見瀏覽器下載通知之間的延遲就越久。Note: The more complicated the report is, the longer the delay between the time you click Print and when you see your browsers download notification. 您也可以按一下 [按一下這裡以檢視報表 PDF。] 強制再次下載。You can also force the download again by clicking Click here to view the PDF of your report..

按一下 [按一下這裡以檢視報表 PDF。] 強制下載 PDF。Force the PDF download by clicking Click here to view the PDF of your report..
ssrs_pdfprint_firefox2ssrs_pdfprint_firefox2

疑難排解用戶端列印功能Troubleshoot Client-Side Printing

如果報表檢視器工具列上的列印按鈕已停用,請確認下列項目:If the print button the report viewer toolbar is disabled, verify the following:

  • Management StudioManagement Studio中報表伺服器的用戶端列印功能已停用。Client-side printing is disabled for the report server in Management StudioManagement Studio. 請參閱本主題中的 啟用及停用用戶端列印功能 一節。See the section Enable and Disable Client-Side Printing in this topic.

  • SQL Server 2016 Reporting Services 或更新版本 (SSRS)SQL Server 2016 Reporting Services or later (SSRS) PDF 轉譯延伸模組已停用。The SQL Server 2016 Reporting Services 或更新版本 (SSRS)SQL Server 2016 Reporting Services or later (SSRS) PDF rendering extension is disabled. 檢閱 <Extension Name="PDF" rsreportserver.config 檔案的 區段。Review the <Extension Name="PDF" section of the rsreportserver.config file.

  • 您正在比較模式中檢視報告,該模式使用舊的 SQL Server 2016 Reporting Services 或更新版本 (SSRS)SQL Server 2016 Reporting Services or later (SSRS) HTML4 轉譯引擎。You are viewing the reporting in comparability mode, which uses the old SQL Server 2016 Reporting Services 或更新版本 (SSRS)SQL Server 2016 Reporting Services or later (SSRS) HTML4 rendering engine. PDF 列印體驗需要 HTML 5 轉譯引擎。The PDF printing experience requires the HTML 5 rendering engine. 按一下工具列上的 [嘗試預覽] 按鈕。Click the Try Preview button on the toolbar.

    ssrs_html5_switch2html5ssrs_html5_switch2html5

啟用及停用用戶端列印功能Enable and Disable Client-Side Printing

報表伺服器管理員可以選擇將報表伺服器系統屬性 EnableClientPrinting 設定為 false,來停用遠端列印功能。Report server administrators have the option of disabling the remote print feature by setting the report server system property EnableClientPrinting to false. 這樣會停用由該伺服器管理的所有報表的用戶端列印功能。This will disable client-side printing for all reports managed by that server. 依預設, EnableClientPrinting 設定為 trueBy default, EnableClientPrinting is set to true. 您可以採用下列方式來停用用戶端列印:You can disable client-side printing in the following ways:

  • 針對 原生模式報表伺服器For a Native mode report server:

    1. 使用系統管理權限來啟動 Management StudioManagement StudioStart Management StudioManagement Studio with administrative privileges.

    2. Management StudioManagement Studio中,連接到報表伺服器執行個體。Connect to a report server instance in Management StudioManagement Studio.

    3. 以滑鼠右鍵按一下報表伺服器節點,然後按一下 [屬性] 。Right-click the report server node, and then click Properties. 如果 [屬性] 選項已停用,請確認您已使用系統管理權限來啟動 Management StudioManagement StudioIf the Properties option is disabled, verify you started Management StudioManagement Studio with administrative privileges.

    4. 按一下 [進階]Click Advanced.

    5. 選取 EnableClientPrinting中報表伺服器的用戶端列印功能已停用。Select EnableClientPrinting.

    6. 設為 True 或 False 然後按一下 [確定] 。Set to True or False and then Click OK.

      ssrs_ssmsproperties_clientprintingssrs_ssmsproperties_clientprinting

  • 針對 SharePoint 模式報表伺服器For a SharePoint mode report server:

    1. 在 SharePoint 管理中心內,按一下 [應用程式管理]In SharePoint Central Administration, click Application Management.

    2. 按一下 [管理服務應用程式]Click Manage service applications.

    3. 按一下 Reporting ServicesReporting Services 服務應用程式的名稱,然後按一下 SharePoint 功能區中的 [管理]Click the name of your Reporting ServicesReporting Services service application, and then click Manage in the SharePoint ribbon.

    4. 按一下 [系統設定]Click System Settings.

    5. 選取 [啟用用戶端列印]Select Enable Client Printing. [啟用用戶端列印] 選項位於靠近頁面底部的位置。The Enable Client Printing option is near the bottom of the page.

    6. 按一下 [確定] 。Click OK.

  • 撰寫指令碼或程式碼,將報表伺服器系統屬性 EnableClientPrinting 設定為 false.Write script or code to set the report server system property EnableClientPrinting to false.

下列範例指令碼說明停用用戶端列印功能的方法之一。The following sample script illustrates one approach for disabling client-side printing. 編譯後執行下列 MicrosoftMicrosoft Visual BasicVisual Basic 程式碼,將 EnableClientPrinting 屬性設定為 [False]Compile and then run the following MicrosoftMicrosoft Visual BasicVisual Basic code to set the EnableClientPrinting property to False. 執行程式碼之後,請重新啟動 IIS。After you run the code, restart IIS.

範例指令碼Sample Script

Imports System  
Imports System.Web.Services.Protocols  
Class Sample  
   Public Shared Sub Main()  
Dim rs As New ReportingService()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  
        Dim props(0) As [Property]  
        Dim setProp As New [Property]  
        setProp.Name = "EnableClientPrinting"  
        setProp.Value = "False"   
        props(0) = setProp  
        Try  
            rs.SetSystemProperties(props)  
        Catch ex As System.Web.Services.Protocols.SoapException  
            Console.Write(ex.Detail.InnerXml)  
        Catch e as Exception  
            Console.Write(e.Message)  
        End Try  
    End Sub 'Main  
End Class 'Sample  

更多問題嗎?More questions? 請嘗試詢問 Reporting Services 論壇Try asking the Reporting Services forum