Skip to Content
0
Former Member
Feb 18, 2011 at 10:34 AM

How do you set the Crystal Report Viewer Printer to Duplex

502 Views

Using the code below I can print in duplex mode, but this does not let me view a report before printing

How do I set the Printer in the Viewer Control Bar of the Crystal Report Viewer to Duplex Printing programmatically rather than having to manually select Duplex through the preferences option?

I have searched but the only example code I found produces errors in the code and will not run

Private myReport As ReportDocument

myReport = New ReportDocument()

myReport.PrintOptions.PaperSize = PaperSize.PaperA4

myReport.PrintOptions.PaperOrientation = PaperOrientation.Portrait

myReport.PrintOptions.PrinterDuplex = PrinterDuplex. Vertical

myReport.PrintToPrinter(3, False, 0, 0)

In my VB6 Project that I am converting to VB.NET when I added Report.PrinterDuplex = crPRDPVertical, this allowed me to view the report and then print with Duplex without having to set the Print Preferences manualy

I found 1386475 - How to set printer name and print job title at runtime using Report Application Server SDK for Visual Studio .NET

But this causes errors

Imports CrystalDecisions.ReportAppServer.ClientDoc

Imports CrystalDecisions.ReportAppServer.Controllers

Dim boReportClientDocument As ISCDReportClientDocument

Dim boPrintOutputController As PrintOutputController

Dim boPrintReportOptions As New PrintReportOptions

Edited by: DavidMills on Feb 18, 2011 11:58 AM