cancel
Showing results for 
Search instead for 
Did you mean: 

Extended printer settings are lost

Former Member
0 Kudos

Most printer drivers offer extended options for printing, e.g. printing multiple pages on one sheet. I'm not sure how such settings are applied to printing processes in .NET because there are no fields in PrinterSettings structures or so. Using PrintDocument in general for WinForms seems to work because these settings are applied. In Crystal Reports when using the printing function of the CrystalReportViewer these settings are applied too. But we are printing multiple reports at a time, so we cannot show every report in the viewer control and let the user print it. So we decided to use the PrintToPrinter method and then the problems started... All the driver specific settings that do not apply to the fields in PrintSettings class of .NET are lost and that's a big problem!

Is there any alternative to the PrinterSettings classes? My idea is using a similar way as the ReportViewer control, showing a printer settings dialog by itself and applying ALL settings internally and then attaching those settings to other reports so that no settings are lost anymore. Is there a solution? Is this supported? The support told me to look for a solution in this forum (I did not find one), then ask for a solution and if there is no solution at all try to make a feature request. We are using CR 2008 Basic and evaluated CR 2008 Trial, the problem relates to both versions and may be others too.

Our workaround to our customers is to add printers in system's control panel with all related settings pre-configured, so that our application only needs to set the printer name. But this results in multiple printers using the same driver and device and needs much more time to maintain and this is not the solution.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

From your description, I believe the issue is that the framework is not able to apply or does not support the extended options for printing. As the Crystal reports assemblies use the framework, it would make sense that these would also not be able to work with extended options for printing. The reason this works in the CR designer, is that the crw32.exe does not use the framework.

As long as the framework is not able to use these options, the CR assemblies for .NET will similarly not work. there is no workaround that I am aware of.

Ludek

Former Member
0 Kudos

That is not true! If you create a PrintDocument object, then attaching a PrinterSettings object to the document and attaching the document to a PrintDialog, all printer settings provided the printer driver are applied to the printing job! This works very fine. I think the printing implementation of CrystalDecisions.CrystalReports.Engine.FormatEngine is the problem because it creates a new PrintDocument instance every time called PrintToPrinter. Last week I did some experimenting with the printing support in .NET. Setting a PrinterSettings object to PrintDocument results in a mix of the printer's default settings and those settings provided by PrinterSettings class (DEVMODE in win32). And this may result in big problems especially with label printers or Fax printers. One PrintDocument object may be used for as many printing jobs as needed. So it seems a solution for me would be to offer a PrintToPrinter method accepting a System.Drawing.Printing.PrintDocument a parameter instead of PrinterSettings. Maybe I should submit a feature request or a bug report?

former_member183750
Active Contributor
0 Kudos

I think you may want to create a phone case and discuss this with a technician. Phone cases can be created here;

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

You could also investigate the Inproc RAS APIs to see if that will help. Sample apps are here:

https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples

Ludek

Former Member
0 Kudos

Sorry, I think I did overlook a small thing. In CR 2008 there are some new overloaded versions of ReportDocument.PrintToPrinter. One of them is accepting PrinterSettings and PageSettings (System.Drawing.Printing) that I seem to be confused with the PrintOptions class of CR. I just did some tests and some printer specific settings that was lost before were now accepted! Now I'll do some more tests with other printers that caused problems before evaluation time ends, but I think if this is the solution, I'll get a full license of CR 2008 then.

If there still occur some more problems I'll post again, but looks good for now. Well, thanks!

Answers (0)