- Home
- Forum
- ASP.NET Web Forms
- thread aborted error on save
thread aborted error on save
Thank you for contacting Syncfusion support.
We are unable to reproduce the mentioned issue at our end. For your reference we have attached the sample which we have tried at our end to reproduce the mentioned issue.
Sample Link
https://www.syncfusion.com/downloads/support/forum/154801/ze/F154801-1793131193
So, kindly provide us complete sample used at your end to reproduce the mentioned issue, so that we can proceed further to analyse and update you with the appropriate details.
Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face.
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Dim document As WordDocument = New WordDocument(sTemplateDoc, FormatType.Docx)
document.Save("Sample.docx", FormatType.Docx, HttpContext.Current.Response, HttpContentDisposition.Attachment)
document.Close()
Thank you for your update.
We have tried to reproduce the reported issue using the provided code example, but it was working fine as expected in our end and the sample which we have used in our end to reproduce the issue can be downloaded from the following link.
Sample link:
https://www.syncfusion.com/downloads/support/forum/154801/ze/ASPNetWebFormsVB1724933921
If you are still facing the same issue, then kindly share the modified sample of above which will helpful for us to provide you the appropriate solution at the earliest.
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Attachment: SyncfusionDocIoTest2_7c1c3bf7.zipx
Thank you for your update.
We can reproduce the reported thread aborted exception in our end, and we suspect it to be a defect. We will validate this issue and update you with more details on 8th June 2020.
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Thank you for your patience.
On further checking the reported issue, we have used HttpResponse.End Method in the saving of word document in Asp.Net MVC platform. This method Sends all currently buffered output to the client, stops execution of the page, and raises the EndRequest event. And also, this method tries to raise a ThreadAbortException exception. So, we suggest you to avoid using try and catch statement while save and returing the word document in MVC platform.
Please refer the below link to know more about the same.
https://docs.microsoft.com/en-us/dotnet/api/system.web.httpresponse.end?view=netframework-4.8
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Thank you for your update.
This is applicable or both MVC and WebForms applications which are returns the output to client. After removing the try catch statement form the sample, the exception not received by catch block and directly sent to client browse and its working fine in our end.
Please find the modified sample from below link.
https://www.syncfusion.com/downloads/support/forum/154801/ze/SyncfusionDocIoTest2774479913
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
I'am using the last version of syncfusion export Component. I use Asp.Net WebForms and my frameword is 4.72. I use the following call:
FlatGridLotacao.DataSource = dtLotacao;
FlatGridLotacao.DataBind();
exp.Export(FlatGridLotacao.Model, FlatGridLotacao.DataSource, "Relatório Usuários Por Departamento de Lotação.xlsx", ExcelVersion.Excel2010, true, true, "flat-lime");
System.Threading.ThreadAbortException: 'Thread was being aborted.' is the error that I getting.
em System.Threading.Thread.AbortInternal()
em System.Threading.Thread.Abort(Object stateInfo)
em Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAs(String fileName, HttpResponse response, ExcelDownloadType downloadType, ExcelHttpContentType contentType)
em Syncfusion.EJ.Export.GridExcelExport.Export(GridProperties gridModel, Object dataSource, Boolean multipleExport)
Hi Edes,
Thanks for contacting syncfusion forum.
We checked your query by preparing sample, but we are unable to reproduce the issue(script error thrown while exporting) at our end.
Please refer to the below attached sample.
After following the above reference, still faced issue please share with us the following details.
- Share the complete Grid code example (both client and server)
- Please share the product detail version.
- Share the issue reproducible sample or reproduce the issue in our shared sample.
The information provided will be helpful to provide you with a response as early as possible.
Regards,
Pon selva
Attachment: webform_export_fdc4f2c9.zip
- 10 Replies
- 4 Participants
- Marked answer
-
BS Bert Sirkin
- Jun 1, 2020 06:54 PM UTC
- Mar 29, 2022 03:33 PM UTC