本文介绍了Crystal报表导出为ex​​cel单元合并问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从Crystal Reports导出时,标记为可以生长的任何字段都将合并到其下面的其他空白行。



这完全搞乱了我的排序。

我建议另一种方法:选择 ExportFormatType.ExcelRecord而不是ExportFormatType.Excel 强>。



如果实际上用户使用ReportViewer工具栏导出按钮导出报表,您可以:




  • 使用 控制。它将以您选择的格式导出报告。



或者从工具栏中隐藏导出按钮并放在以编程方式导出的页面按钮中




  • 致电 方法



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




  • 致电 方法



reportDocument.ExportToDisk(ExportFormatType.ExcelRecord,report.xls); p>


  • 导出数据集到excel(查看)



您可以选择最适合您需求的方式,但必须尝试如果它与您在开发或发布服务器中使用的运行时一起使用



ExportFormatType.ExcelRecord 意味着生成一个xls文件,无格式。如果您设置标记为可以增长的 ExportFormatType.Excel 字段,则会合并到其下面的空白行。


When I export from Crystal Reports, any fields that are marked as Can Grow are merged with an otherwise blank row below them.

This completely messes up my sorting. How can I resolve this?

解决方案

I suggest another way: choose ExportFormatType.ExcelRecord instead of ExportFormatType.Excel. The xls file will be created without formatting.

If actually the user is exporting report using ReportViewer Toolbar Export button you can:

  • Replace the CrystalReportViewer Control with the ReportExporter Control. It will export the report in the format you choose.

Or hide Export button from toolbar and put in the page buttons that exports programmatically

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

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

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. If you set ExportFormatType.Excel fields that are marked as "Can Grow" are merged with an otherwise blank row below them.

这篇关于Crystal报表导出为ex​​cel单元合并问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 22:49