Ver Mensaje Individual
  #8 (permalink)  
Antiguo 17/05/2006, 07:35
Avatar de GeoAvila
GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 21 años, 4 meses
Puntos: 53
bueno aqui te pongo un ejemplo
Código:
Option Explicit
Private crApp As New CRAXDRT.Application
Private crReport As New CRAXDRT.Report
Private Sub CargarReporte()
Dim crParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim crParamDef As CRAXDRT.ParameterFieldDefinition
On Error GoTo ErrHandler
'Abrir el reporte
Screen.MousePointer = vbHourglass
 
mflgContinuar = True
Set crReport = crApp.OpenReport(App.Path & "\ReportesSQL\RptCuadre.rpt", 1)
' Parametros del reporte
Set crParamDefs = crReport.ParameterFields
For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "fecha"
crParamDef.AddCurrentValue (Format(FechaFin.value, "DD/MM/yyyy")) 'un parametro de fecha
Case "usuario"
crParamDef.AddCurrentValue (Val(TxtCodUsr.Text)) ' un parametro de numero
End Select
Next
CRViewer1.ReportSource = crReport
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Set crParamDefs = Nothing
Set crParamDef = Nothing
Exit Sub
ErrHandler:
If Err.Number = -2147206461 Then
MsgBox "Error al cargar el reporte", _
vbCritical + vbOKOnly
Else
MsgBox Err.Description, vbCritical + vbOKOnly
End If
mflgContinuar = False
Screen.MousePointer = vbDefault
End Sub
Nos Vemos
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila