Help Needed- Crystal report exported in Crystal Report Format

  • 14 years ago
     
    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 password.
    4)     I have to export report to crystal format and emailed to user, so that user can open it.But it should n't prompt for password while opening the report.
     
    Any assistance in this regard is highly appreciated
     
    The code is as follows:
    Public Sub Generate_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
     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell