
04/09/2006, 06:16
|
| | Fecha de Ingreso: marzo-2005
Mensajes: 276
Antigüedad: 20 años, 1 mes Puntos: 0 | |
CR y VB 6 impresoras Bueno, esto no es una pregunta es algo que quiero explicaros pq realmente hay muy poca información sobre ello y creo que muchos de vosotros lo agradeceréis:
a la hora de imprimir un report desde vb utilizando crystal por defecto siempre sale la impresora que tenemos predeterminada, pues con este código podréis visualizar todas las impresoras disponibles para imprimir el informe por la que queramos.
Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)
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
End Sub |