Issue when exporting to .pdf format

Stimulsoft Reports.WEB discussion
Post Reply
smart+
Posts: 26
Joined: Thu Sep 09, 2010 4:53 pm
Location: Croatia

Issue when exporting to .pdf format

Post by smart+ »

Hello,


we using following code for exporting report to .pdf format:
using (StiReport report = new StiReport())
{
report.Load(HttpContext.Current.Server.MapPath("../Reports/CourseTopics.mrt"));
report.Dictionary.Variables["idcourse"].ValueObject = nIDcourse;
report.Dictionary.Variables["academicyear"].ValueObject = (oParams.Length == 1 ? oParams[0] : 2010);

report.Render(false);
Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this.Page, report, true);
}
On our development server we can't reproduce this issue, but on production server we have issue when we do this.

On client side in web application it seams exporting work OK, but Event viewer constantly get below warning in application log when our users exporting report in .pdf format:
Event code: 3005
Event message: An unhandled exception has occurred.

Exception information:
Exception type: HttpException
Exception message: The remote host closed the connection. The error code is 0x80070040.

Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.Web.HttpResponse.Flush()
at Stimulsoft.Report.Web.StiReportResponse.ResponseAs(Page page, MemoryStream stream, String contentType, String fileName, Boolean openDialog)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, Boolean openDialog, StiPdfExportSettings settings)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean exportRtfTextAsImage, Boolean openDialog, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges, StiPdfEncryptionKeyLength keyLength, Boolean useUnicode)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean exportRtfTextAsImage, Boolean openDialog, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges, StiPdfEncryptionKeyLength keyLength)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFont, Boolean standardPdfFonts, Boolean openDialog, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean openDialog)
at Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(Page page, StiReport report, Boolean openDialog)
at Lumens.App.AppLayer.GetTestPdfReport(Int32 nIDtest, Int32 nReporttype, Page CurrentPage, Object[] oParams)
at TestsControl.ShowReport(Object sender, DirectEventArgs args)
at Ext.Net.ComponentDirectEvent.OnEvent(DirectEventArgs e)
at Ext.Net.Observable.FireAsyncEvent(String eventName, ParameterCollection extraParams)
at Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Do you know solution for this issue?

Best regards,
Sasa
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Issue when exporting to .pdf format

Post by Vladimir »

Hello,

Please try to set the following option to False:

Code: Select all

StiOptions.Web.AllowUseResponseFlush = false;
Thank you.
smart+
Posts: 26
Joined: Thu Sep 09, 2010 4:53 pm
Location: Croatia

Issue when exporting to .pdf format

Post by smart+ »

For now all works OK with this option.

Thank you and best regards,
Sasa
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Issue when exporting to .pdf format

Post by Andrew »

Excellent!

:biggrin:
Post Reply