RE:Como puedo llamar un reporte de Crystal?
bueno esta es la rutina que yo usaba para llamar mis reportes hechos en crystal 8.5.... bueno suerte..
Public Sub ImprimeReporte(ByVal stArchivo As String, _
ByVal rsReporte As ADODB.Recordset, _
Optional pDestinoReporte As DestinoReporte = 1, _
Optional iNroCop As Integer = 1, _
Optional EnviaParam As Boolean, _
Optional ArrayParameters As Variant, _
Optional swORientacion As Integer, _
Optional TamanoPapel As CRPaperSize)
Dim CR_App As CRAXDRT.Application
Dim CR_Rpt As CRAXDRT.Report
Dim lErrNo As Long
Dim sErrDesc As String
On Error GoTo ErrHandler
Set CR_App = New CRAXDRT.Application
Set CR_Rpt = New CRAXDRT.Report
Set CR_Rpt = CR_App.OpenReport(stArchivo)
'-
If EnviaParam = True Then
Dim i As Integer
For i = 0 To UBound(ArrayParameters)
CR_Rpt.ParameterFields(i + 1).AddCurrentValue ArrayParameters(i)
Next i
End If
CR_Rpt.SelectPrinter Printer.DriverName, Printer.DeviceName, Printer.Port
CR_Rpt.Database.SetDataSource rsReporte
CR_Rpt.PaperOrientation = swORientacion
If TamanoPapel > 0 Then
CR_Rpt.PaperSize = TamanoPapel
End If
If pDestinoReporte = dstPantalla Then
FrmReporte.CRViewer1.ReportSource = CR_Rpt
FrmReporte.CRViewer1.ViewReport
FrmReporte.Show vbModal
Else
If iNroCop = 0 Then iNroCop = 1
CR_Rpt.PrintOut blMostrarPant, iNroCop
End If
Set CR_App = Nothing
Set CR_Rpt = Nothing
Exit Sub
ErrHandler:
MsgBox "Ocurrio el Sgt Error " & Chr(13) & Err.Description, vbCritical, "Advertencia"
End Sub