medina04 de Octubre del 2004
PreguntaMe parece que ya han pedido informacion sobre este asunto.
Pero quisiera. que alguien me expliacar como hacerle para quitar el BUG. Cuando mando a llamar el reporte a ventana me sale este error (\\\"No se puede abrir el Servidor SQL\\\"). Estoy programando en VB6 con una base de datos de Acces, con un reporte de Crys Rep. 8 en Sapñol.. Este es el ccodigo en Mi boton de Vista Previa:
___________
Private Sub btnImprimir_Click() \\\\' Llenar las formulas del reporte
On Error GoTo errores
With CrystalReport1
.ReportSource = crptReport \\\\' Nombre de
archivo del reporte
.ReportFileName = ReporteTicketSalida
.DataFiles(0) = BaseDeDatos \\\\' Nombre de la
base de datos
.Formulas(1) = \\\"COPIA = \\\\'\\\" + copia + \\\"\\\\'\\\"
.Formulas(2) = \\\"EHORA = \\\\'\\\" + lblNEHora.Caption + \\\"\\\\'\\\"
.Formulas(3) = \\\"SHORA = \\\\'\\\" + lblNSHora.Caption + \\\"\\\\'\\\"
.Formulas(4) = \\\"PBRUTO = \\\" +
.Formulas(5) = \\\"PTARA = \\\" +
Format$(lblNPBruto.Caption, \\\"\\\")
Format$(lblNPTara.Caption, \\\"\\\")
.Formulas(6) = \\\"PNETO = \\\" +
Format$(lblNPesoNeto.Caption, \\\"\\\")
.Formulas(7) = \\\"PTIPO = \\\\'\\\" + lblTPeso.Caption + \\\"\\\\'\\\"
.Formulas(8) = \\\"USU = \\\\'\\\" + nombreUsuario + \\\"\\\\'\\\"
.SelectionFormula = \\\"{ticketSalida.ticket} = \\\" +
Str$(ticket)
.WindowTitle = \\\"Ticket Salida #\\\" + Str$(ticket) + \\\" \\\" +
copia
.ReportFileName = App.Path + \\\"\\\\ticketsalida.rpt\\\"
.RetrieveDataFiles
-------------------------------------------------------------
.Action = 1 \\\\' Imprimir
[[[[[[[[[ linea bug ]]]]]]]]]]]]
-------------------------------------------------------------
End With
On Error GoTo 0
salida:
Exit Sub
errores: \\\\' Manejo de errores
If DBEngine.Errors.Count > 0 Then
Call MsgBox(DBEngine.Errors.Item(0).Description, vbOKOnly + vbExclamation, \\\"Aviso\\\")
Else
Call MsgBox(Str$(Err.Number) + \\\": \\\" + Err.Description, vbOKOnly + vbExclamation, \\\"Aviso\\\")
Resume salida
End If
Resume salida
End Sub
___________
SE LOS AGRADECERE MUCHO
Pero quisiera. que alguien me expliacar como hacerle para quitar el BUG. Cuando mando a llamar el reporte a ventana me sale este error (\\\"No se puede abrir el Servidor SQL\\\"). Estoy programando en VB6 con una base de datos de Acces, con un reporte de Crys Rep. 8 en Sapñol.. Este es el ccodigo en Mi boton de Vista Previa:
___________
Private Sub btnImprimir_Click() \\\\' Llenar las formulas del reporte
On Error GoTo errores
With CrystalReport1
.ReportSource = crptReport \\\\' Nombre de
archivo del reporte
.ReportFileName = ReporteTicketSalida
.DataFiles(0) = BaseDeDatos \\\\' Nombre de la
base de datos
.Formulas(1) = \\\"COPIA = \\\\'\\\" + copia + \\\"\\\\'\\\"
.Formulas(2) = \\\"EHORA = \\\\'\\\" + lblNEHora.Caption + \\\"\\\\'\\\"
.Formulas(3) = \\\"SHORA = \\\\'\\\" + lblNSHora.Caption + \\\"\\\\'\\\"
.Formulas(4) = \\\"PBRUTO = \\\" +
.Formulas(5) = \\\"PTARA = \\\" +
Format$(lblNPBruto.Caption, \\\"\\\")
Format$(lblNPTara.Caption, \\\"\\\")
.Formulas(6) = \\\"PNETO = \\\" +
Format$(lblNPesoNeto.Caption, \\\"\\\")
.Formulas(7) = \\\"PTIPO = \\\\'\\\" + lblTPeso.Caption + \\\"\\\\'\\\"
.Formulas(8) = \\\"USU = \\\\'\\\" + nombreUsuario + \\\"\\\\'\\\"
.SelectionFormula = \\\"{ticketSalida.ticket} = \\\" +
Str$(ticket)
.WindowTitle = \\\"Ticket Salida #\\\" + Str$(ticket) + \\\" \\\" +
copia
.ReportFileName = App.Path + \\\"\\\\ticketsalida.rpt\\\"
.RetrieveDataFiles
-------------------------------------------------------------
.Action = 1 \\\\' Imprimir
[[[[[[[[[ linea bug ]]]]]]]]]]]]
-------------------------------------------------------------
End With
On Error GoTo 0
salida:
Exit Sub
errores: \\\\' Manejo de errores
If DBEngine.Errors.Count > 0 Then
Call MsgBox(DBEngine.Errors.Item(0).Description, vbOKOnly + vbExclamation, \\\"Aviso\\\")
Else
Call MsgBox(Str$(Err.Number) + \\\": \\\" + Err.Description, vbOKOnly + vbExclamation, \\\"Aviso\\\")
Resume salida
End If
Resume salida
End Sub
___________
SE LOS AGRADECERE MUCHO
