![]() |
VB6 y CR8... HELP¡ Hola de nuevo, ahora mi problema es un poco mas especifico y es que estoy cargando un CR8 a un VB6. El error que me marca es "No coinciden los Tipos", esto se refiere a las variables me supongo, y despues de estudiar mas detenidamente el codigo encuentro dos puntos en donde no entiendo que hacen esos comandos y es en la parte de declaración de varibales: "Private Instancia As New CRAXDRT.Application" "Private Report as New CRAXDRT.Report" Como yo agregue un Crystal Report a mi forumulario la sentencia para llamarlo es esta: "Dim Report As New CrystalReport1" Aqui la pregunta es si deberia ir a si: Private Instancia As New CRAXDRT.Application Private Report as New CrystalReport1 y a lo hora de mandar llamarlo a si: Set Report = CrystalReport1 en vez de: Set Report = Intancia.OpenReport(App.Path & "Direccion) Ademas los parametros, deben de venir del formulario donde estan los parametros, junto con las variables en donde se encuentran los valores de cada una, mi pregunta es, tienen que estar declaradas como generales ? Public Sub frmrendimiento(Nombre As String, Edad As Long, Peso As Long, Estatura As Long, SH As Long, RMD As Long, FA As Long, A As Long, VD As Long, FD As Long, VR As Long, HCR As Long) strnombre = Nombre Lngedad = Edad Lngpeso = Peso Lngestatura = Estatura LngSH = SH LngRMD = RMD LngFA = FA LngA = A LngVD = lVD LngFD = FD LngVR = VR LngHCR = HCR Bueno, esto creo que es mucho pero si tuvieran tiempo y Ganas de hecharle un vistaso a mi codigo me daria mucho gusto: Dim Continuar As Boolean Dim strnombre As String Dim stredad As Long Dim strpeso As Long Dim strestatura As Long Private LngSH As Long Private LngRMD As Long Private LngFA As Long Private LngA As Long Private LngVD As Long Private LngFD As Long Private LngVR As Long Private LngHCR As Long Dim Instancia As New CRAXDRT.Application Dim Report As New CrystalReport1 Public Sub frmrendimiento(Nombre As String, Edad As Long, Peso As Long, Estatura As Long, SH As Long, RMD As Long, FA As Long, A As Long, VD As Long, FD As Long, VR As Long, HCR As Long) strnombre = Nombre Lngedad = Edad Lngpeso = Peso Lngestatura = Estatura LngSH = SH LngRMD = RMD LngFA = FA LngA = A LngVD = lVD LngFD = FD LngVR = VR LngHCR = HCR End Sub Private Sub Form_Activate() If Not Continuar Then Unload Me End Sub Private Sub Form_Load() Dim ColParam As CRAXDRT.ParameterFieldDefinition Dim Parametro As CRAXDRT.ParameterFieldDefinition On Error GoTo ErrHandler Screen.MousePointer = vbHourglass Continuar = True Set Report = CrystalReport1 Set ColParam = Report.ParameterFields For Each Parametro In ColParam Select Case Parametro.ParameterFieldName Case "Nombre" crParamDef.AddCurrentValue (strnombre) Case "Edad" crParamDef.AddCurrentValue (stredad) Case "Peso" crParamDef.AddCurrentValue (strpeso) Case "Estatura" crParamDef.AddCurrentValue (strestatura) Case "Salto Horizontal" crParamDef.AddCurrentValue (LngSH) Case "Resistencia 1/2 duracion" crParamDef.AddCurrentValue (LngRMD) Case "Fuerza Abdominal" crParamDef.AddCurrentValue (LngFA) Case "Agilidad" crParamDef.AddCurrentValue (LngA) Case "Velocidad de desplazamiento" crParamDef.AddCurrentValue (LngVD) Case "Fuerza Dorsal" crParamDef.AddCurrentValue (LngFD) Case "Velocidad de reacción" crParamDef.AddCurrentValue (strVR) Case "Habilidad Contra Reloc" crParamDef.AddCurrentValue (LngHCR) End Select Next 'Llamar y Mostrar el Reporte CRViewer1.ReportSource = Report CRViewer.DisplayGroupTree = False CRViewer1.ViewReport Screen.MousePointer = vbDefault Set Parametro = Nothing Set ColParam = Nothing Exit Sub 'Asignacion del Procedimiento de Error ErrHandler: If Err.Number = -2147206461 Then MsgBox ("El archivo de reporte no se encuentra, restáurelo de los discos de instalación "), vbCritical + vbOKOnly, "Pantalla de Error" Else MsgBox Err.Description, vbCritical + vbOKOnly, "Pantalla de Error" End If Continuar = False Screen.MousePointer = vbDefault End Sub Private Sub Form_Resize() CRViewer1.Top = 0 CRViewer1.Left = 0 CRViewer1.Height = ScaleHeight CRViewer1.Width = ScaleWidth End Sub Private Sub Form_Unload(Cancel As Integer) Set Report = Nothing Set Instancia = Nothing End Sub Gracias. |
| La zona horaria es GMT -6. Ahora son las 10:16. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.