Page 1 of 2
Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Tue Dec 02, 2014 10:22 pm
by damtur
Since upgrading our ASP.Net website to 2014.3.0, the following code results in an error "[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}"
Code: Select all
var settings = new StiPdfExportSettings()
{
UseUnicode = true,
StandardPdfFonts = false,
EmbeddedFonts = true
};
SetLayoutForPrint(rep, rvRequest.ReportParameters);
rep.Render(false);
// Respond with generated PDF
StiReportResponse.ResponseAsPdf(this, rep, false, settings);
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Tue Dec 02, 2014 10:28 pm
by damtur
I should have been clearer, it's failing on the ResponseAsPDF call.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Wed Dec 03, 2014 5:52 am
by HighAley
Hello.
Sorry, but we need more information about this error.
Could you send us a full error stack and a sample project that reproduces the issue with step-by-step instruction?
Thank you.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Wed Dec 03, 2014 6:35 am
by damtur
Try it yourself.
Create a new ASP.Net website. Add Stimulsoft.Base, Stimulsoft.Report and Stimulsoft.Web dlls as references.
You can see the code I'm using in the attached screenshot.
It shows the stack trace is not being very helpful.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Wed Dec 03, 2014 8:26 am
by Alex K.
Hello,
We couldn't reproduce this bug.
Please send us a sample project with test data for analysis.
Thank you.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Wed Dec 03, 2014 9:05 pm
by damtur
Here is a test project which reports the error, written in VS2013
I am running on a 64bit PC and IIS is configured to run in non-32bit mode.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Thu Dec 04, 2014 8:13 am
by HighAley
Hello.
Unfortunately, we can't reproduce your issue because you load report from assembly with next code. But there is no such file.
Code: Select all
StiReport rep = StiReport.GetReportFromAssembly(@"C:\Testing\Reports\Standard\Report.mrx");
Furthermore, the mrx-file is not an assembly and it's impossible to use it with this method. Please, read the
Storing Reports article.
Also you use next connection string in the report and there is no necessary database to reproduce the issue.
Code: Select all
rep.Dictionary.Databases.Add(new StiOleDbDatabase("TEST",@"Data Source=localhost;Initial Catalog=MyDB;Integrated Security=False;User ID=userid;Password=password;Provider=OLEDB"));
Please, send us a working sample project which will help us to reproduce your issue.
Thank you.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Thu Dec 04, 2014 11:02 am
by damtur
The mrx file is a compiled report, a dll essentially. Surely you have one of those lying around?
The connection string is a made up one because we cannot send you our databases for IP reasons. You can probably ignore this anyway.
The report object gets created ok, but the ResponseAsPDF fails
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Fri Dec 05, 2014 12:34 pm
by HighAley
Hello.
Please, try to put the ResponseAsPDF in try-catch.
Code: Select all
try
{
// Respond with generated PDF
StiReportResponse.ResponseAsPdf(this, rep, false, settings);
}
catch(System.Threading.ThreadAbortException ex1)
{
// do nothing
//
}
The error is not from our side. You could read more information on following links:
http://support.microsoft.com/kb/312629/en-us
https://briancaos.wordpress.com/2010/11 ... g-aborted/
Thank you.
Re: Upgraded to 2014.3.0 ResponseAsPDF Error
Posted: Sun Dec 07, 2014 10:30 pm
by damtur
Interesting. That seems to work.
Apologies for wasting your time, but it was odd to us that this used to work fine without errors being thrown and since we upgraded the exception occurred.
Thanks for the tip.