Skip to Content
0

WPF Crystal Report Viewer Ignores Printer Preferences

Feb 20, 2017 at 01:57 PM

153

avatar image
Former Member

Hello All,

I am having a problem getting the printer settings to work correctly with the WPF Crystal Report Viewer. I have a report that is intended to be printed on a label printer, and has been saved with the label printer in the report. When the report is opened with the WPF version of the report viewer, it defaults to the printer selected in the report (the label printer).

However, the printer preferences (mainly the paper size) do not get pulled in. Instead, default settings get pulled in, despite the fact that the preferences for the printer are set to the correct values in devices and printers. To make matters more confusing, this problem does not occur on my development machine, or on 1 of the 11 computers that I have tested it on.

As some additional information: The report was developed in Crystal Reports 11 SP4, the application is 32-bit C# WPF w/.NET 4.6.1, both the development and client machines run Windows 64 bit, and all machines are running crystal SDK version 13.0.18.2192.

This application is intended to replace an older WinForms .Net 4.5 application that is currently running on the machines. The WinForms report viewer pulls in the printer preferences correctly.

I appreciate any assistance you can offer,

Brandon Kramer

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Feb 21, 2017 at 07:08 PM
0

I did not find out a solution to get the preferences to be loaded correctly through the report viewer's print dialog. Instead I created a custom print button using the WinForms PrintDialog class (since the ReportDocument has a PrintToPrinter overload for PrinterSettings, but not for PrintQueue) and placed it on top of the built in print button. The WinForms dialog loads the correct printer settings for the printer. It isn't ideal, but it works, so I am considering this resolved.

Share
10 |10000 characters needed characters left characters exceeded