报表中的线程被异常中止 [英] Thread was being aborted exception in Reports

查看:81
本文介绍了报表中的线程被异常中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



将报表导出到PDF时,我们已经收到线程正在中止"异常.

我们正在使用以下代码将报告导出为PDF.

Hi,

We have been getting "Thread was being aborted" Exception when a report is being exporting to PDF.

We are using the following code to export report into a PDF.

Response.Buffer = false;
               Response.ClearContent();
               Response.ContentType = "application/pdf";
               Response.ClearHeaders();

               //Export the Report to Response stream in PDF format and file name Customers
               myReportDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, Session["ReportName"].ToString() + "_" + DateTime.Now.ToString());






如果我使用ExportStream()而不是ExportToHttpResponse(),则不会抛出异常.

请参阅以下我用于ExportStream()的代码






If i am using ExportStream() instead of ExportToHttpResponse(),no exception it is being throwing.

see the below code i am using for ExportStream()

MemoryStream mem = (MemoryStream)myReportDoc.ExportToStream(ExportFormatType.PortableDocFormat);
                    Response.Clear();
                    Response.Buffer = true;
                    Response.ContentType = "application/pdf";
                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.BinaryWrite(mem.ToArray());





但是这里的问题是它没有在报告附件对话框中没有显示打开按钮,而只是显示了保存和取消.对于我的客户要求,他们不想保存每个报告.


请在任何情况下为我提供合适的解决方案.





But here the problem is it is not showing the open button in the report attachment dialog, just it is showing save and cancel only.As for my client requirement they don''t want to save the each and every report.


Please help me either any case with suitable solution.

推荐答案

一个星期前有类似问题(有答案),请检查
Response.End()抛出错误 [
Similar question(with answers) a week ago, check it
Response.End() throwing error[^]


这篇关于报表中的线程被异常中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆