Skip to Content

Printing out of Viewer suggests wrong printer

Apr 13 at 01:36 PM


avatar image

I'm using CRVS with SP18.

The Viewer works with PrintMode set to "PrintMode.PrintOutputController". Now when the report is drawn in the viewer, the customer clicks on the Print-Button in the toolbar which internally executes CrystalDecisions.Windows.Forms.CrystalReportViewer.PrintReport().

When the print dialog opens, the default printer is suggested. How can I propose another printer to the customer?

I tried several ways setting the printer for the viewer print dialog:

  • CrystalDecisions.CrystalReports.Engine.PrintOptions.PrinterName
  • CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportClientDocument.PrintOutputController.GetPrintOptions.PrinterName
  • CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions.PrinterName
  • System.Drawing.Printing.PrintDocument.PrinterSettings.PrinterName

None of them works....



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

3 Answers

Don Williams
Apr 13 at 03:16 PM

Hi Patrick,

In my test app see what it returns.

Likely cause is you have No Printer checked on and maybe Dissociate not checked on.

In that case you have not told the engine what printer to select so it will always default to the default printer.

In more current versions of CR Designer when you Print the report you'll see the Saved Printer name and Saved Paper size in the dialog box.

If you don't see this in your reports the default is is to use the Default printer, we can't select a printer if you don't tell us which one to use....


10 |10000 characters needed characters left characters exceeded
Patrick Simons 6 days ago

The report has no saved printer name.

My initial question should be: depending on the PrintMode of the Viewer (POC or P2P) is it important to choose the right fitting method (also RAS - Engine, POC...) to set the printer for the Viewer?


10 |10000 characters needed characters left characters exceeded
Don Williams
3 days ago

Hi Patrick

Ah, that changes things...

Depends on your reports. So for basic letter paper size reports then using P2P will always select the users Default printer, that is basic work flow for P2P, cannot change it. And if you use Dissociate the engine will try to find a matching paper size and margins for the Users default printer.

For custom paper sizes it's always better to use a specific printer or using POC to set the printer at run time.

Years ago most Rep's suggested using no printer option. Updates in CR 2008+ now we recommend not using No Printer, I've never suggested that except in special cases.

Basic differences are P2P uses the Windows Printer Common dialog box, POC uses the same Dialog box CR Designer uses and gives you more control over the printers.

So it's more of what ever fits your application is the better one to use.

I do suggest not using No Printer because the report formatting engine then uses USP10.dll and GDIPlus and some of the users default printer properties. Even with basic paper sizes it can cause margin issues, some printers have less printable area so it can cause formatting changes.

Best thing to do is always use a real printer when designing reports, check on Dissociate and save the report. This way if the Printer cannot be found CR will look for the same "family" of printers the report was designed against and format accordingly.

If you need specific paper sizes, for preprinted forms and those types then always use a specific printer family and class of printers. And name all of the custom paper sizes with the exact same name, the Engine/RAS will look for the paper size name first and then by ENUM.

So to answer your question it's all up to you which one works best but depends on the work flow and how the reports are designed and if they need to use specific printers and printer properties.

Just remember when No Printer is selected it uses USP10.dll, GDIplus and the users default printer to format.

Some Developers actually saves the printer properties into a database field with the ability to update the defaults in their app interface and then use CopyTo/CopyFrom to save/update the report printer properties. That way it's consistent and then do't have to use multiple routines to manage them.

Lot's of options, lot's of features, all depends on how much you want make it User Proof...

May also cause you to list specific printers you support... but again all depends on your application and reports.


10 |10000 characters needed characters left characters exceeded