I can not get my crystal 8.5 report to print in duplex mode programmatically.
The printer is a duplex printer. I can step through and see the properties of the report object being modified by my code. I can print just fine if I use "Report.PrinterSetup Me.hWnd". But I have to manually choose duplex mode in the printer setup each time. The user does not need to see the preview of the report either. Am I missing something?
Here is the my code:
Dim Viewer AS CRAXDRT.Application
Dim Report AS CRAXDRT.Report
Set Viewer = New CRAXDRT.Application
Set Report = Viewer.OpenReport("XYZ.rpt"
Report.SelectPrinter pDriverName, pPrinterName, pPortName
Report.PaperOrientation = crLandscape
Report.PrinterDuplex = crPRDPHorizontal
Report.ParameterFields.Item(1).AddCurrentValue 52446
Report.ParameterFields.Item(2).AddCurrentValue -1
Report.DisplayProgressDialog = True
Report.Database.Tables(1).SetLogOnInfo "MyServer", "MyDatabase", "User", "Pwd"
Report.PrintOut True
Set Report = Nothing
Set Viewer = Nothing
Thanks!
The printer is a duplex printer. I can step through and see the properties of the report object being modified by my code. I can print just fine if I use "Report.PrinterSetup Me.hWnd". But I have to manually choose duplex mode in the printer setup each time. The user does not need to see the preview of the report either. Am I missing something?
Here is the my code:
Dim Viewer AS CRAXDRT.Application
Dim Report AS CRAXDRT.Report
Set Viewer = New CRAXDRT.Application
Set Report = Viewer.OpenReport("XYZ.rpt"
Report.SelectPrinter pDriverName, pPrinterName, pPortName
Report.PaperOrientation = crLandscape
Report.PrinterDuplex = crPRDPHorizontal
Report.ParameterFields.Item(1).AddCurrentValue 52446
Report.ParameterFields.Item(2).AddCurrentValue -1
Report.DisplayProgressDialog = True
Report.Database.Tables(1).SetLogOnInfo "MyServer", "MyDatabase", "User", "Pwd"
Report.PrintOut True
Set Report = Nothing
Set Viewer = Nothing
Thanks!