Aspose Issue in Excel reports

When trying to generate the report with Aspose Cells 10 times using parallel threads, an error pop-message is shown once or twice as below.

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:
PMingLiU;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:“Times New Roman”;
mso-ansi-language:EN-US;mso-fareast-language:ZH-TW;mso-bidi-language:AR-SA”>If
we click on YES, few of the rows from the excel sheet are getting removed where
excel feels that there is some unreadable content is available.

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;mso-fareast-font-family:
PMingLiU;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:“Times New Roman”;
mso-ansi-language:EN-US;mso-fareast-language:ZH-TW;mso-bidi-language:AR-SA”>

We have tried multiple options :

1. 1. There are 20 tabs in the report which will be generated simultaneously with Multi-threading concept in .Net. – Not working. Error pop-message is shown.

2. 2. There are 20 tabs in the report which will be generated simultaneously with task concept in .Net. – This is also Not working and is showing Error pop-message is shown.

3. 3. There are 20 tabs in the report and generated the code in such a way, the tabs are generated one after the other – It is working fine, but the performance is degraded.


Attached is the error screen shot.


Hi,


Thanks for providing us some details.

Please download and try our latest version/fix: Aspose.Cells for .NET v7.7.2.3 and see if it makes any difference.

If your problem still occurs, then please provide us a project (runnable) with latest version/fix v7.7.2.3 to reproduce the issue on our end. We will check your issue soon. Also provide us your template files (input + output etc.)

By the way, please make sure that all your threads or code segments work on different Workbooks. For your information, Aspose.Cells (being created in manged .NET APIs) does support multithreading, but you need to consider a few things here. For example, the component can be used in mutlithreading environment, however you will have to create/use separate workbook/ template Excel file instance in separate threads. You cannot share any shared resources between threads least you may find unstable data or corrupt data. If you have any shared resources, then you will have to synchronize the access by yourself. So, please use different workbooks in different threads on a safer side.

Thank you.

Hi,

Just to add more description .

We create an workbook using following code:

workbook = engine.Excel.Workbooks.Open(FDPTemplateMarker, ExcelOpenType.Automatic);

FDPTemplatemarker is report marker path.

We have 20 sheets in report, we create 20 threads and pass one worksheet to each of the threads.

param.WorkSheet = workbook.Worksheets[reportNode.Attributes["sheetName"].Value];

Each thread fills the data in worksheets. After thread execution completes, we perform some formatting in all sheets and save the workbook as follows

workbook.SaveAs(FDPWinFilePath);

Is there a better way to handle this scenario?

Hi,


As I said in my previous post, please make sure that all your threads or code segments work on different Workbooks, please check my previous reply. You got to create/use separate workbook/ template Excel file instance in separate threads. You cannot share any shared resources between threads least you may find unstable data or corrupt data. As you have the shared resources (you are filling worksheets in a single workbook), you will have to synchronize the access by yourself.

Thanks for your understanding!