Ver Mensaje Individual
  #21 (permalink)  
Antiguo 15/04/2008, 06:06
Cristhian_HC
 
Fecha de Ingreso: abril-2008
Mensajes: 2
Antigüedad: 16 años
Puntos: 0
Ayuda!!!: Crystal Report 9 ó 10? en Visual Basic 6.0!

Hola korku he diseñado un procedimiento almacendo en sql 2000 y a su vez he diseñado el reporte en cristal report 9.0, pero en visual basic 6.0 intento paasr los parametros necesarios para la consulta y aparace el reporte en cristal report visor , pero no aparece como la cunsulta q le di, solo aparecen los datos con q se agrego el procedimiento a cristal report, q puede ser,,, te paso el codigo para q lo veas...

Option Explicit

Private crApp As New CRAXDRT.Application
Private crReport As New CRAXDRT.Report

Private mflgContinuar As Boolean
Private mstrParametro1 As Integer
Private mlngParametro2 As Integer
Private mlngParametro3 As Date

Public Sub PasarParametros(sParam1 As Integer, lParam2 As Integer, lParam3 As Date)
mstrParametro1 = sParam1
mlngParametro2 = lParam2
mlngParametro3 = lParam3

End Sub

Private Sub Form_Resize()
crViewer.Top = 0
crViewer.Left = 0
crViewer.Height = ScaleHeight
crViewer.Width = ScaleWidth

End Sub

Private Sub Form_Activate()
If Not mflgContinuar Then Unload Me

End Sub

Private Sub Form_Load()
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("C:\Documents and Settings\Administrador\Escritorio\Sistema de Compras y Ventas\Sistema Segun Carlos\Reportes\stockxAlmacen.rpt", 1)

' Parametros del reporte
Set crParamDefs = crReport.ParameterFields

For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "Parametro1"
crParamDef.AddCurrentValue (mstrParametro1)

Case "Parametro2"
crParamDef.AddCurrentValue (mlngParametro2)

Case "Parametro3"
crParamDef.AddCurrentValue (mlngParametro3)

End Select

Next

crViewer.ReportSource = crReport
crViewer.ViewReport
Screen.MousePointer = vbDefault

Set crParamDefs = Nothing
Set crParamDef = Nothing
Exit Sub

ErrHandler:
If Err.Number = -2147206461 Then
MsgBox "El archivo de reporte no se encuentra, restáurelo de los discos de instalación", _
vbCritical + vbOKOnly
Else
MsgBox Err.Description, vbCritical + vbOKOnly
End If

mflgContinuar = False
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Unload(Cancel As Integer)
Set crReport = Nothing
Set crApp = Nothing

End Sub
Los parametros q le envio estan bien, el prodimiento almacenado tambien esta bien, eso lo te revisado, pero no c si en la pagina del guille algo habra oviado. espero me respondas a la brevedad.

de antemano te agradesco un monton