Unable to open report exported in Crystal rep
Hi,
Sub: Unable to open the Crystal report exported in Crystal Report Format
1) I have used Oracle Native connection, while designing the report.
2) I have passed the record set to the report at run time.
3) Exported the report to Crystal Report Format, But I could nât able to open report, while opening , the report asks for OLEDB information, even though I used Native connection at design time.
4) In Crystal Report 8.5, connect driver property, but I am using crystal reports XI and in Visual Basic 6.0, Is there any method or property to convert the connection?. As I have to export report to crystal format and emailed to user, so that user can open it.
Any assistance in this regard is highly appreciated
The code is as follows:
Public Sub Aging_REPORT(strSQL As String, sReportName As String, sDestFileName As String, ReportTitle As String)
On Error GoTo Err
Dim CrAppl As CRAXDRT.Application
Dim crrep As CRAXDRT.Report
Dim rsCrystal As ADODB.Recordset
Set CrAppl = New CRAXDRT.Application
Set crrep = CrAppl.OpenReport(sReportName) 'Opens the report
Set rsCrystal = New ADODB.Recordset
rsCrystal.Open strSQL, Conn, adOpenStatic, adLockReadOnly
rsCrystal.Requery
With crrep
.DiscardSavedData
.Database.LogOnServer "crdb_oracle.dll", strServerName, "", strUserName, strPassword
.ReportTitle = ReportTitle
.Database.SetDataSource rsCrystal, 3 'LINK REPORT TO RECORDSET
.VerifyOnEveryPrint = True
End With
With crrep.ExportOptions
.DestinationType = crEDTDiskFile
.FormatType = crEFTCrystalReport
.DiskFileName = sDestFileName
End With
crrep.Export (False)
Set crrep = Nothing
Set CrAppl = Nothing
Exit Sub
Err:
MsgBox Err.Description
End Sub
Thanks,
|