如何将.rpt文件转换为csv
答
您可以使用Crystal Reports ReportDocument对象动态打开它们,然后调用.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.ExcelRecord,Filename)函数。
VB.NET示例:
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
答
如果这些是Crystal Reports .rpt文件(并且您有兼容版本的Crystal Reports),最简单的方法是在Crystal Reports设计器中打开它们并导出为CSV。
提取在.rpt文件的数据?你的意思是保存的数据与报告? – Manjoor 2010-06-23 11:36:18