简体   繁体   English

从Crystal Reports导出未格式化的Excel数据

[英]Export unformatted Excel data from Crystal Reports

I need to export excel file with crystal report. 我需要使用Crystal Report导出Excel文件。

Is there any way to export data only without formatting by using code? 有什么方法可以仅导出数据而无需使用代码进行格式化?

You can export data shown in the report without formatting, in different ways: 您可以通过不同的方式导出报告中显示的数据而无需格式化:

1- Replace the CrystalReportViewer Control with the ReportExporter Control. 1-用ReportExporter控件替换CrystalReportViewer控件。 It will export the report in the format you choose. 它将以您选择的格式导出报告。

2- Call ExportToHttpResponse method 2-调用ExportToHttpResponse方法

CrystalReportSource1.ReportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, this.Response  , false, "report.xls");`

3- Call ExportToDisk method 3-调用ExportToDisk方法

reportDocument.ExportToDisk(ExportFormatType.ExcelRecord, "report.xls");

4- Export dataset to excel (Look at Ahmed answer ) 4- 将数据集导出到excel(查看Ahmed答案

You can choose the way that best fits your needs, but you must try if it works with the runtime you use either in development or in release server . 您可以选择最适合自己需求的方式,但是必须尝试使其与在开发或发行服务器中使用的运行时一起使用

ExportFormatType.ExcelRecord means that is generated an xls file, without formatting. ExportFormatType.ExcelRecord意味着生成的xls文件无需格式化。 If you set ExportFormatType.Excel fields that are marked as "Can Grow" are merged with an otherwise blank row below them.. 如果设置了ExportFormatType.Excel则将标记为“可以增长”的字段与它们下面的空白行合并。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM