Crystal Report:导出到Excel生成“分页符”,列标题重复
尝试将报告导出到 Excel,生成的文档有某种分页符。列标题重复。 “分页符”的位置与我生成 PDF 报告时的位置相同。
导出excel时如何去掉这个分页符?有页面大小定义吗?
Trying to export a report to excel, the generated document has kind of page break. The column header is repeated. The "page break" are in the same positition than if I generate a PDF report.
How can I remove this page break when exporting to excel? Is there some page size definition?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过 ExportFormatType.ExcelRecord 而不是 ExportFormatType.Excel?将创建不带格式的 xls 文件。
如果用户实际上使用 ReportViewer 工具栏导出按钮导出报表,您可以:
或者从工具栏中隐藏导出按钮并放入以编程方式导出的页面按钮
CrystalReportSource1.ReportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, this.Response , false, "report.xls");
reportDocument.ExportToDisk(ExportFormatType.ExcelRecord, "report.xls");
您可以选择最好的方式适合您的需求,但您必须尝试它是否适用于您在开发或发布服务器中使用的运行时。
ExportFormatType.ExcelRecord表示生成一个xls文件,没有格式化。如果您设置 ExportFormatType.Excel 标记为“可以增长”的字段将与其下方的空白行合并。
Have you tried 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:
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.