I have Developed a Crystal report and it takes paper size of fanfold 12" X 15". Now my problem is how can I set Report to Size 12"x15" and printer to Epson DFX 8500 through VB COde.
Help Me
Printable View
I have Developed a Crystal report and it takes paper size of fanfold 12" X 15". Now my problem is how can I set Report to Size 12"x15" and printer to Epson DFX 8500 through VB COde.
Help Me
Quote:
Originally posted by Sonamg
I have Developed a Crystal report and it takes paper size of fanfold 12" X 15". Now my problem is how can I set Report to Size 12"x15" and printer to Epson DFX 8500 through VB COde.
Help Me
u can use
commondialog1.showprinter 'to select the printer and paper size
commondialog1.printerdefault = true ' to make it the default printer for VB app. to print
to set the paper size.
Though I can do the way you suggest me.... but problem is after I select the Printer and Papersize the crystal report size remains same and points to other printer.
Is there way through which code can control what ever changes I made through commondiloge.printer effect to crystal report too
loop through the printer's collection & set the default printer for your application to EPSON.
like
x = 0 ' it may be 1,2,3... depends upon your control panel installed printer settings.
set printer = printers(x)
And then run Crystal Report
as Jaiboy mentioned...
--------------
For Each X In Printers
If UCase(Trim(X.DeviceName)) = UCase(Trim(str_ReportPrinter )) Then
Report.SelectPrinter Printer.DriverName, str_ReportPrinter, Printer.Port
Report.PaperOrientation = crPortrait
Report.PaperSize = crPaperA4
End If
Next
-----------
str_ReportPrinter is your printer name variable