on ‎2023 Feb 03 3:06 PM
I saw similar posts related to Windows Server 2016. However, I didn't see resolution there other than to get SP24.
We're having an issue with setting CrystalReportViewer control default printer. We're running winforms application on Windows Server 2019 in Azure environment and remoting into the server using Remote Desktop Connection.
Previous environment was on prem on Windows Server 2008.
We run a .net application, all reports written in Crystal Reports 11 SP2.
When running the application to view the report and clicking the print button, default printer is not automatically selected.
It always points to "Microsoft Print To PDF". If I select another printer as my default, it only remembers it as long as I have my session open.
If client manually selects one of the redirected printers, their reports do print to the selected printer.
On 2008 servers under HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices there are plenty or redirect values.
Under 2019 the registry looks different. I can see the new key and value under HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices\.... and default printer I selected.
However, it disappears as soon as I close the application.
We also cannot set default printer in ReportDocument.PrintOptions.PrinterName, same code base is shared among multiple clients.
Any suggestion here please? Can we try latest SP considering that we're on a quite old version of Crystal?
Thank you in advance.
Request clarification before answering.
CR for VS doesn't like Microsoft's Redirected Printers also known as Easy Print because it doesn't actually create an entry into the DEVMODE structure. Easy Print is kind of an InProc Printer so CR doesn't have access to it.
Crystal is still built using C++ and accesses all the old C++ structures.
You have to install the real printer driver.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, upgrading the version of the SDK you're using will help. There have been no significant changes to the internal structure of the .rpt file since Crystal 2011, so using a more recent version of the SDK that supports newer operating systems, such as Windows Server 2019 will make a difference. There are also a number of security updates in the newer versions.
You will have to recompile your program with the latest version of the SDK (currently SP33) and then install the latest version of the runtime on the machine where your application is running. You can find links to download the .exe that integrates Crystal into Visual Studio and the various runtime installs to use when deploying your application in the Crystal for VS wiki. The wiki also includes information about some code changes you may need to make, depending on which version of the SDK you're currently using.
Finally, the problem you're having with the printer settings is due to security changes to the operating system - they're not a Crystal issue per se.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.