D
dorrit.Riemenschneider
I've developed a sharepint webpart (ASP.NET 2.0 application) with use
of the CrystalReportViewer web control
(CrystalDecisions.Web.CrystalReportViewer). All works fine except the
export of the report associated to the CrystalReportViewer. I use the
following source code:
CrystalDecisions.Web.CrystalReportViewer crViewer = new
CrystalDecisions.Web.CrystalReportViewer();
CrystalDecisions.Web.CrystalReportSource crSource = new
CrystalDecisions.Web.CrystalReportSource();
CrystalDecisions.CrystalReports.Engine.ReportDocument crSource = null;
crSource.Report.FileName = reportFilename;
crDocument = crSource.ReportDocument;
this.Controls.Add(crViewer);
//...some other stuff
//...
//here comes the export
ExportOptions options = new ExportOptions();
options.ExportFormatType = ExportFormatType.PortableDocFormat;
crDocument.ExportToHttpResponse(options, this.Page.Response, true,
"report");
The export itsself works but a ThreadAbortException is thrown at the
ExportToHttpResponse method and the execution of the page stops.
I've already found that it is a new feature at ASP.NET 2.0 to abort
the thread at Response.End or Response.Redirect (see http://
support.microsoft.com/kb/312629/EN-US/). But this doesn't really solve
my problem.
How can I prevent the ThreadAbortException from being thrown?
Thanks, Dorrit
of the CrystalReportViewer web control
(CrystalDecisions.Web.CrystalReportViewer). All works fine except the
export of the report associated to the CrystalReportViewer. I use the
following source code:
CrystalDecisions.Web.CrystalReportViewer crViewer = new
CrystalDecisions.Web.CrystalReportViewer();
CrystalDecisions.Web.CrystalReportSource crSource = new
CrystalDecisions.Web.CrystalReportSource();
CrystalDecisions.CrystalReports.Engine.ReportDocument crSource = null;
crSource.Report.FileName = reportFilename;
crDocument = crSource.ReportDocument;
this.Controls.Add(crViewer);
//...some other stuff
//...
//here comes the export
ExportOptions options = new ExportOptions();
options.ExportFormatType = ExportFormatType.PortableDocFormat;
crDocument.ExportToHttpResponse(options, this.Page.Response, true,
"report");
The export itsself works but a ThreadAbortException is thrown at the
ExportToHttpResponse method and the execution of the page stops.
I've already found that it is a new feature at ASP.NET 2.0 to abort
the thread at Response.End or Response.Redirect (see http://
support.microsoft.com/kb/312629/EN-US/). But this doesn't really solve
my problem.
How can I prevent the ThreadAbortException from being thrown?
Thanks, Dorrit