Crystal Report - Ejecutar informe crystal desde vb6

 
Vista:

Ejecutar informe crystal desde vb6

Publicado por Jose Gpe. (1 intervención) el 05/02/2001 07:06:43
Hola amigos, estoy haciendo mis primeros reportes en vb6, y necesito saber como ejecutar un informe de crystal (pantalla e impresora), y como pasarle parametros para seleccionar informacion por rangos de fechas o numero de factura. Ojalá me pudieran proporcionar algunos codigos de ejemplo. Gracias por su ayuda.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ejecutar informe crystal desde vb6

Publicado por Pablo Romero (10 intervenciones) el 07/02/2001 15:37:53
Tenes que hacer una forma con el componente de Crystal Report y le pones un nombre eje.: rep

Luego cuando mandas a pedir el reporte que ya debe de estar creado en crystal, en Visual podes poner lo siguiente ejemplo:

Private Sub Cmdrepor_Click()
Dim fechaini As Date
Dim fechafin As Variant
On Error Resume Next
With rep
.ReportFileName =App.Path& "\Reporteextras.rpt"
.Destination = 0
.WindowBorderStyle = 3
.WindowControlBox = True
.WindowMaxButton = False
.WindowMinButton = False
.WindowTitle = "Reporte de Horas Extras Detallado"
.WindowHeight = (MainForm.ScaleHeight - MainForm.StatusLine.Height) / Screen.TwipsPerPixelY
.WindowWidth = MainForm.ScaleWidth / Screen.TwipsPerPixelX
.WindowLeft = MainForm.Left / Screen.TwipsPerPixelX + 4
.WindowTop = (MainForm.Top + (MainForm.Height - MainForm.ScaleHeight) * 2 / 2) / Screen.TwipsPerPixelY - 4
End With
fechaini = Format(Mask1.Text, "dd/mm/yyyy")
fechafin = Format(Mask2.Text, "dd/mm/yyyy")

rep.SelectionFormula = "{EntradasySalidasExtras.fecha} >= date(" & Mid(fechaini, 7, 4) + ", " + Mid(fechaini, 4, 2) + ", " + Mid(fechaini, 1, 2) + ") and {EntradasySalidasExtras.fecha} <= date(" & Mid(fechafin, 7, 4) + ", " + Mid(fechafin, 4, 2) + ", " + Mid(fechafin, 1, 2) + ") and {EntradasySalidasExtras.depto} >= '" & text3.Text & "' and {EntradasySalidasExtras.depto} <= '"
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar