RE:actualizar crystal report
Para pasar párametros al crystal es de la siguiente manera...
Set crpParamDefs = crReport.ParameterFields
For Each crpParamdef In crpParamDefs
With crpParamdef
Select Case .ParameterFieldName
Case "FechaParte"
crpParamdef.AddCurrentValue (strDate & vbNullChar)
Case "FechaImpresion"
crpParamdef.AddCurrentValue (frmInformes.dtFechaImpresion.Value & vbNullChar)
Case "FechaInicial"
crpParamdef.AddCurrentValue (frmInformes.dtIntervaloInicial.Value)
Case "FechaFinal"
crpParamdef.AddCurrentValue (frmInformes.dtIntervaloFinal.Value)
Case "Param1"
If Right(streport, 14) = "Accidentes.rpt" Or Right(streport, 17) = "AccidentesCar.rpt" Then
crpParamdef.AddCurrentValue (frmInformes.MortalesCheck.Value & frmInformes.GravesCheck.Value _
& frmInformes.GravesCheck.Value & frmInformes.LevesCheck.Value _
& frmInformes.IlesosCheck.Value)
Else
crpParamdef.AddCurrentValue (Val(frmInformes.OrdenacionCombo.ListIndex + 1) & vbNullChar)
End If
Case "Param2"
crpParamdef.AddCurrentValue (frmInformes.AgrupaciónText.Text & vbNullChar)
Case "Capitulo"
If Right(streport, 26) = "MaterialesListadoFecha.rpt" Then
crpParamdef.AddCurrentValue (strCapitulos & vbNullChar)
Else
crpParamdef.AddCurrentValue (frmInformes.GrupoCombo.Text & vbNullChar)
End If
Case "Operacion"
If Right(streport, 16) = "OperacionCar.rpt" Or Right(streport, 24) = "OperacionDescripcion.rpt" _
Then
crpParamdef.AddCurrentValue (frmInformes.cmoOperaciones.ItemData(frmInformes.cmoOperaciones.ListIndex) & vbNullChar)
End If
Case "Grupo"
If Right(streport, 14) = "PersonalOp.rpt" Or Right(streport, 18) = "CategoriaGrupo.rpt" Or Right(streport, 19) = "MaquinariaGrupo.rpt" Then
crpParamdef.AddCurrentValue (frmInformes.GrupoCombo.ItemData(frmInformes.GrupoCombo.ListIndex))
End If
If Right(streport, 17) = "PersonalOpThr.rpt" Or _
Right(streport, 21) = "CategoriaGrupoThr.rpt" Or _
Right(streport, 22) = "MaquinariaGrupoThr.rpt" Then
crpParamdef.AddCurrentValue (frmInformes.GrupoCombo.ItemData(frmInformes.GrupoCombo.ListIndex))
End If
Case Else
Call infPanel.InformationOutput(vbCritical, _
"Error en informe. Nombre de parámetro desconocido")
Exit Sub
End Select
End With
Next
CrystalActiveXReportViewer1.ReportSource = crReport
CrystalActiveXReportViewer1.DisplayGroupTree = False
CrystalActiveXReportViewer1.ViewReport
Set crpParamDefs = Nothing
Set crpParamdef = Nothing