水晶报表导出到 HTML [英] Crystal Reports export to HTML
问题描述
我在 ASP.NET 4.0 应用程序中使用 CrystalReports 13 (13.0.2000.0).
我需要以 HTML 格式导出报告,因为我想要一个静态报告页面,而不需要允许用户交互的报告查看器.
I use CrystalReports 13 (13.0.2000.0) in an ASP.NET 4.0 application.
I need to export report in HTML because i want a static report page, without reporviewer that allows user interaction.
如果我尝试以下代码:
Source1.ReportDocument.ExportToHttpResponse(
CrystalDecisions.Shared.ExportFormatType.HTML32 /*or HTML40*/
, this.Response , false, "report");
应用程序产生错误(详情:不支持以 HTML 格式导出 HTTP 响应.)
Application generates an error (Detail: Export in HTTP response in HTML format is not supported.)
如果我尝试 ReportExporter,HTML32 和 HTML40 在 ExportFormat 中不可用.
If i try ReportExporter, HTML32 and HTML40 are not available ase ExportFormat.
有人可以帮忙吗?
推荐答案
报表可以在 HTML 中查看
Report can be viewed in HTML as
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)
rd.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.HTML40);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "text/html";
Response.BinaryWrite(oStream.ToArray());
Response.End();
但格式可能会受到影响.
But the format may suffer.
参考:如何在 ASP.NET 中导出 Crystal Report
这篇关于水晶报表导出到 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!