Page 1 of 1

Issue when exporting to .pdf format

Posted: Thu Jun 02, 2011 2:36 am
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

Issue when exporting to .pdf format

Posted: Fri Jun 03, 2011 1:23 am
by Vladimir
Hello,

Please try to set the following option to False:

Code: Select all

StiOptions.Web.AllowUseResponseFlush = false;
Thank you.

Issue when exporting to .pdf format

Posted: Tue Jun 07, 2011 12:47 am
by smart+
For now all works OK with this option.

Thank you and best regards,
Sasa

Issue when exporting to .pdf format

Posted: Tue Jun 07, 2011 10:44 am
by Andrew
Excellent!

:biggrin: