Crystal Reports导出为HTML [英] Crystal Reports export to HTML
问题描述
我在ASP.NET 4.0应用程序中使用CrystalReports 13(13.0.2000.0)。
我需要导出HTML报表,因为我想要一个静态报表页面,没有reporviewer允许用户交互。
如果我尝试以下代码:
Source1.ReportDocument。 ExportToHttpResponse(
CrystalDecisions.Shared.ExportFormatType.HTML32 / *或HTML40 * /
,this.Response,false,report);
应用程序生成错误(详细信息:不支持HTML格式的HTTP响应导出。)
如果我尝试ReportExporter,HTML32和HTML40不可用于ExportFormat。
有人可以帮助吗?
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();
但格式可能会受到影响。
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.
If i try the following code:
Source1.ReportDocument.ExportToHttpResponse(
CrystalDecisions.Shared.ExportFormatType.HTML32 /*or HTML40*/
, this.Response , false, "report");
Application generates an error (Detail: Export in HTTP response in HTML format is not supported.)
If i try ReportExporter, HTML32 and HTML40 are not available ase ExportFormat.
Can someone help?
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.
Reference: How to Export Crystal Report in ASP.NET
这篇关于Crystal Reports导出为HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!