Charles Okwuagwu
Charles Okwuagwu

Reputation: 10866

how do i convert .rpt files to csv

I inherited an old vb6 app that handles .rpt files. i need to extract the data in the files into a csv format so i can import into sql server.

Please help. thanks

Upvotes: 0

Views: 6538

Answers (2)

Josaph
Josaph

Reputation: 429

You can dynamically open them utilizing the Crystal Reports ReportDocument object and then call the .ExportToDisk(CrystalDecisions.Shared.ExportFormatType.ExcelRecord, Filename) Function.

VB.NET Example:


Dim Report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Report.Load(ReportPathHere)

' Set Report Parameters;
Report.SetParameterValue("@PARAM1", Nothing)

' Generate PDF of report
Report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.ExcelRecord, FileName & ".xls")

' Clean up
Report.Close()
Report = Nothing

Upvotes: 1

user359040
user359040

Reputation:

If those are Crystal Reports .rpt files (and you have a compatible edition of Crystal Reports), the simplest way would be to open them in the Crystal Reports designer and export to CSV.

Upvotes: 1

Related Questions