I am trying to export a Crystal ReportDocument using ExportToHttpResponse
like so:
report.ExportToHttpResponse(exportOptions, HttpContext.Current.Response, true, "test");
When I first tried to run this, I received a System.Threading.ThreadAbortException
. After reading about how this is a known error with ExportToHttpResponse
in this question, I tried implementing the suggested workaround of wrapping the statement in a try/catch block like so:
try
{
report.ExportToHttpResponse(expOptions, HttpContext.Current.Response, true, "test");
}
catch (System.Threading.ThreadAbortException e)
{
}
As I understand it, this should catch and ignore the error, and proceed. However, I am still getting the System.Threading.ThreadAbortException
on the closing bracket of the catch statement. My question is why is the exception still being received even though I am apparently catching it, and how could I go about fixing it so that the exception is ignored?