Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/08/2012, 16:21
Avatar de Jamsito
Jamsito
 
Fecha de Ingreso: agosto-2012
Mensajes: 28
Antigüedad: 11 años, 9 meses
Puntos: 0
Pregunta Mandar a Imprimir un Reporte en CrystalReports con un boton directamente?

Que tal señores espero me puedan ayudar...
actualmente en donde trabajo hay un sistema viejo el cual manda a imprimir un reporte creado en CrystalReports 4.6 .... el sistema esta creado en VB5

bueno pues funciona bien sin embargo estamos migrando a VB2010 y necesito saber como llamo la impresion de dicho reporte pero desde VB2010 ?? enviando dos parametros

este es el codigo del VB5 para que se hagan una idea de como lo manda a imprimir donde "MENUDESPACHOS" es una forma que contiene el control de "CrystalReports"

Código:
'INDICA DONDE SE ESTA UBICADO EL ARCHIVO REPORTE A IMPRIMIR
MENUDESPACHOS.CrystalReport1.ReportFileName = App.Path & "\despacho3.rpt"

'MANDA LA INSTRUCCION DE QUE SE VA IMPRIMIR
MENUDESPACHOS.CrystalReport1.Destination = crptToPrinter

'SE INDICA QUE SON SOLO 1 COPIA DEL REPORTE
MENUDESPACHOS.CrystalReport1.CopiesToPrinter = 1 

'SENTENCIA SQL EN EL CUAL SE LE MANDAN 2 PARAMETROS LOS CUALES SE INGRESAN EN 2 TEXTBOX 
SQL = "{COMPRAS_ENC.CODIGO_TIPO_COMPRA} = " + Text1.Text + " and {COMPRAS_ENC.CODIGO_DE_COMPRA} = " + Text2.Text

'AQUI REMPLAZA EL CODIGO QUE SE ENVIO ARRIBA PARA EJECUTAR EL REPORTE QUE SE INDICO SEGUN LOS PARAMETROS
MENUDESPACHOS.CrystalReport1.ReplaceSelectionFormula SQL

'MANDA A IMPRIMIR
MENUDESPACHOS.CrystalReport1.Action = 1
Espero me puedan ayudar

Graciass