Dear Friends,
I am Using Crystal report 9.0 Enterprice Edition.
I want a vbcode to print report directly without preview the report. and also need the code to select the printer If the system is connected more than one printer.
Thank a lot.
Printable View
Dear Friends,
I am Using Crystal report 9.0 Enterprice Edition.
I want a vbcode to print report directly without preview the report. and also need the code to select the printer If the system is connected more than one printer.
Thank a lot.
To bring up CR's Print Setup dialog box...
HTHVB Code:
'Bring up CR Printer Setup dialog Report.PrinterSetup lHwnd gsOrientation = Report.PaperOrientation 'Save orientation into var Printer.Orientation = Report.PaperOrientation Report.SelectPrinter Report.DriverName, Report.PrinterName, Report.PortName gsPrinterName = Report.PrinterName 'Save other settings to vars gsPrinterDriver = Report.DriverName '... gsPortName = Report.PortName '... '... 'Set the report source (if using already opened ADO recordset). 'Report.Database.SetDataSource oRs, 3, 1 '... 'Then you can set the report to whatever the user selected and print out. Report.DisplayProgressDialog = True Report.SelectPrinter gsPrinterDriver, gsPrinterName, gsPortName Report.PaperOrientation = gsOrientation Report.PrintOut True, 1
hello, sorry to bring this thread back up. It's just that I have a very similar problem but I can't figure out how to use the previous solution in my code.
My programme consists of a database with a table of registered user data and a table of the donations these registered people have done.
when the programme first starts up you see a switchboard which can send you to a form to edit the user data, donations, etc. ; or it can send you to some reports of the user data. I have made the first report, and I can view it in the crystal report viewer.. No problems there. (I can even press the print button of the crystal report viewer and it works)
The problem is now that I have a printbutton next to the button to open the crystal report viewer (CRV). So what I would need is a way to print the report without having to open it first and then manually click the print button on the CRV.