Cita:
Iniciado por InformaticaLogica
Hola soy nuevo en esto del CrystalR. 10 y no se que para donde disparar.
Bueno yo ingrese el componente Crystal Reports a un formulario e ingrese estas librerias: Crystal ActiveX Report Viewer Library 10.0 Y Crystal Report ActiveX Designer Run TIme library 10.0.
Al componente Crystal le coloco el nombre "crinforme" y un boton con este codigo:
crInforme.Destination = crptToWindow
crInforme.ReportFileName = "E:\Ejercicios Visual\Ejemplo1\reporte.rpt"
crInforme.Action = 1
Pero al ejecutarlo me tira este error:
Error '20525' en tiempo de ejecucion :
unable to load report.
Bueno espero que me puedan ayudar, ya que tengo el sistema casi terminado y me falta tirar los resumenes de cuenta.
Desde ya muchas gracias.
Hola,
No sé como funciona el CR10 pero tengo un ejemplo para CR8
Código:
Private Sub Command1_Click()
Dim rsTempRecordset As New ADODB.Recordset
Dim CR_CustomApp As New CRAXDRT.Application
Dim CR_CustomReport As CRAXDRT.Report
Dim prn As Printer
With cnCMS
.CursorLocation = adUseClient
.ConnectionString = "MSDASQL.1;" & _
"Persist Security Info=True;" & _
"User ID=sa;" & _
"Password='';" & _
"Data Source=CMS"
.Open
End With
With rsTempRecordset
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = cnCMS
.LockType = adLockOptimistic
.Source = "Select * from prueba "
.Open
End With
Set CR_CustomReport = CR_CustomApp.OpenReport("c:\crystal\prueba.rpt", 1)
For Each prn In Printers
If prn.DeviceName Like "*LaserJet*" Then
Set Printer = prn
Exit For
End If
Next
CR_CustomReport.SelectPrinter prn.DriverName, prn.DeviceName, prn.Port
CR_CustomReport.DiscardSavedData
CR_CustomReport.PaperOrientation = 2
CR_CustomReport.Database.SetDataSource rsTempRecordset
CR_CustomReport.PrintOut False
Set CR_CustomReport = Nothing
Set rsTempRecordset = Nothing
cnCMS.Close
End Sub
Un saludo