2147030 - ER- Add PrintOutputController to .CR NET Windows form View Print Button

SAP Knowledge Base Article - Public

2147030 - ER- Add PrintOutputController to .CR NET Windows form View Print Button

Symptom

The Java web viewer has the ability to select PDF or ActiveX Print modes

Enhancement Request:

.NET Windows Form Viewer should have the ability to select the default PrintToPrinter or PrintOutputController.

Environment

  • Crystal Reports for Visual Studio

Reproducing the Issue

Enhancement Request. Idea Place

Resolution

Idea Place suggestion -

https://ideas.sap.com/SAPCrystalReports/D25062?status_id_filter={335897B6-05D7-4568-8804-3F55E3B39025}&current_tab=Recent&row_num=1&getparameters=1

After dropping the CR Windows.form.Viewer onto your form you will now see a new property called:

  • PrintMode

With the option to select

  • PrintToPrinter
  • PrintOutputController

as the default print API when selecting the viewers Print button.

In code you can make this selectable also using the following:

  • crystalReportViewer1.PrintMode = PrintMode.PrintToPrinter;
  • crystalReportViewer1.PrintMode = PrintMode.PrintOutputController; 

Note: The PrintToPrinter API has not changed and will be the default value.

PrintOutputController uses the same printer dialog box as Crsytal Reports Designer users so this should be more familiar to end users.

Please NOTE: One issue has been discovered where the Paper Tray value saved in the Report is not selected in the Printer Dialog box when using POC mode.

To control this using a registry key add the following:

For CR for VS SP 16:

  • 32 bit machine: [HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports for .NET]
  • 64 bit machine: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports for .NET]

For BI 4.1/4.2

  • 32 bit machine: [HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports for .NET]
  • 64 bit machine: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports for .NET]

Add "PrintMode" as String value:

  • If the value is set to "PrintToPrinter", the WinForm will use PrintToPrinter to print the report.
  • If the value is set to "PrintOutputController", the WinForm will use PrintOutputController to print the report.
  • If other value is set, this key will not take effect.
  • Both "PrintToPrinter" and "PrintOutputController" are case insensitive.
  • This key will override the “PrintMode” set in Crystal Reports Viewer property page.

Keywords

Crystal Reports for Visual Studio, Windows.Form.Viewer, POC, P2P , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio