Skip to Content
Aug 13, 2015 at 03:03 PM

Print Custom Size Report using PrintToPrinter function


Hi all,

I am using Crystal report 13.0.2000.0 runtime v2.0.50727 with Win7 .NET Winforms application.

I need to print custom size labels on Zebra printer by using PrintToPrinter command. I set the following parameters in my code:

MyReportDocument.PrintOptions.DissociatePageSizeAndPrinterPaperSize = True

MyReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Portrait

MyReportDocument.PrintOptions.PrinterDuplex = PrinterDuplex.Simplex

printPrompt.PrinterSettings.DefaultPageSettings.PaperSize.Height = 400

printPrompt.PrinterSettings.DefaultPageSettings.PaperSize.Width = 400

oLayout.Scaling = PrintLayoutSettings.PrintScaling.DoNotScale

MyReportDocument.PrintToPrinter(printPrompt.PrinterSettings, printPrompt.PrinterSettings.DefaultPageSettings, False, oLayout)

The problem is that the report keeps using the driver settings for the paper (6x2), and I would like to use my custom 4x4 size.

I know that I need to disassociate printer. But when I do so, the system refuses to use DoNotScale setting, and scales to fit the size difined in the driver. The driver itself allows to override the settings:

Is there a way to override driver settings and print custom size?

Thank you.