Hi,
Sub: How to set password to exported Crystal Report
We have
VB 6.0, Crystal Reports Xi and Oracle 10 G.
I have designed a report using Oracle native connection and passed data at run time.
Exported the report to Crystal Report Format. But while opening the report, the exported report (destination report) asks for password.
Is there any way to set the password to the expoted report in Visual Basic.
Here is my code:
Dim CrAppl As CRAXDRT.Application
Dim crrep As CRAXDRT.Report
Dim crrepDest As CRAXDRT.Report
Dim strsql As String
Set CrAppl = New CRAXDRT.Application
Set crrep = CrAppl.OpenReport(sReportName) 'Opens the report
With crrep
.Database.LogOnServer "crdb_oracle.dll", strServerName, "", strUserName, strPassword
.DiscardSavedData
.SQLQueryString = strsql
.ReportTitle = strReportCriterias
.Database.Verify
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
I would appreciate your help in this regard.
Thanks,