Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplex Printing Crystal Report

Status
Not open for further replies.

PCJock

Programmer
Feb 12, 2002
16
0
0
US
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!
 
I wanted to update everyone. I solved my problem. It still does not work programatically with VB. But, I found another solution. I had our server admin create a new printer that pointed to the same printer. We then modified the default properties, so that the new printer would always print in duplex mode. We just gave the new printer the same name as the old one, but added a suffix of "Duplex". Works great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top