| ID | Asunto | Fecha | Nick | |
| 52002 | Como anular ventana toma datos Campos Parametro | 03/03/10 21:34 | abinfra | |  |
Cuando se crea en CR11.5 un Campo de Parámetro, al ejecutar desde VB6 el informe .rpt donde está dicho Campo de Parámetro, antes de aparecer el informe propiamente dicho, aparece una ventana titulada “Introducir Valores” para reseñar el valor que queremos pasarle al Campo de Parámetro. ¿Qué hay que hacer para que no aparezca dicha ventana, a fin de pasar el valor para el Campo de Parámetro (en mi caso lo he llamado Prueba) por código VB6 desde la form que llama al informe .rpt? El código que tengo en dicha form es: Private Sub Form_Load()
Dim crParamDefs As
CRA<img src='imagenes/smiles/descojono.png' border='0'
alt='descojono' />RT.ParameterFieldDefinitions
Dim crParamDef As
CRA<img src='imagenes/smiles/descojono.png' border='0'
alt='descojono' />RT.ParameterFieldDefinition
On Error GoTo ErrHandler
Screen.MousePointer = vbHourglass
mflgContinuar = True
Set rsPed = New ADODB.Recordset
strSQL = "SELECT * FROM PedidSEA WHERE Numero = '" & TBcNumPed & "'"
rsPed.Open strSQL, g_db, adOpenDynamic, adLockOptimistic
Set crReport = objApp.OpenReport(App.Path & "\A4LiPeSEA.rpt", 1)
Set crParamDefs = crReport.ParameterFields
For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "Prueba"
crParamDef.AddCurrentValue (TBcNumPed)
End Select
Next
With crReport
.Database.SetDataSource rsPed
.PaperOrientation = 1
.PaperSize = 0
.DiscardSavedData
End With
With crViewer1
.ReportSource = crReport
.ViewReport
.Zoom (95)
End With
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 objApp = Nothing
End Sub |
|
| ID | Asunto | Fecha | Nick | |
| 52023 | Re: Como anular ventana toma datos Campos Parametro (Resp: 52002) | 04/03/10 21:16 | abinfra | |  |
Solucionado en otro hilo por ing_najib así:
"Yo los inserto en el vb a lo mejor crece un poco el ejecutable pero te evitas algunos problemas... De hecho si ya tienes el reporte para insertarlo en vb agregas la referencia, luego como si agregaras un modulo pero seleccionas Crystal Report 10 y le dices archivo existente, despues te pregunta que si deseas utilizar el crViewer le dices que si, luego te pregunta que si lo dejas como principal le dices que no y listo."
Saludos cordiales. [Editado: abinfra, 05/03/2010 09:11:12]
Si esta respuesta resuelve tu duda, por favor pulsa en la de este mensaje. Gracias. |