SAP Knowledge Base Article - Public

2631171 - Server Default printer always selected when using Remote Desktop or Citrix client into a CR for VS application or Crystal Reports Designer

Symptom

A User is printing from a Windows 2016 Citrix/Terminal Server. The same issue also occurs with Remote Desktop 2016.

When selecting the CR Viewers print button the printer dialog box appears, PrintToPrinter and PrintOutputCOntroller are used in CR Desktop Viewer, the Citrix Servers default printer is always selected.

In previous versions of RDC and Citrix it was the Users default printer that was selected.

Environment

  • Crystal Reports, Devloper for Visual Studio
  • Crystal Reports Designer ( not confirmed )
  • Citrix 2016 Server
  • Remote Desktop Communicator

Cause

This issue appears to be a change that was done for Remote Desktop connections using a new registry key for the Remote Session.

Looking at the registry tree it appears MS is now generating a Session ID under this tree which is the Users WorkStation default printer:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices\S-1-5-5-0-8281985 - Device = PDF995 (redirected 1),winspool,Ne01:

Note: The Session ID is different each time a user connects - S-1-5-5-0-8281985

CR for VS's Viewer is using this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows - Device = Microsoft Print to PDF,winspool,Ne01:

This is the Windows Servers default printer and is selected

Resolution

This issue has now been escalated to R&D for a solution in SP 24.

R&D discovered Microsoft changed the default behaviour when dealing with the Users Default printer on Server 2016

CR used this to get it: GetSysProfileString (_N("windows"), _N("device"), _N("")) to get the default printer

We are now using: ::GetDefaultPrinter to get the default Users local printer

See Also

A quick Google search found this link which may be related or explain what changed:

https://social.technet.microsoft.com/Forums/ie/en-US/785cbcc6-4f0b-4d88-b12f-2b1d89b85a44/remoteapp-default-printer-redirection-not-working-in-server-2016?forum=winserverTS

Keywords

Default Printer always selected, cr for vs, Remote Desktop, Citrix Server. , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports, developer version for Microsoft Visual Studio