GridWeb JS issue when importing Excel file on postback

Hi,


First of all, here is my test environment : Windows 7, IE11. I recently upgrade the GridWeb library to the latest version (8.6.0.0) on my project and unfortunatly it causes me an issue. Each time I call ImportExcelFile function on callback, a javascript error happens.

I attached to this post a sample project which shows the issue. You just have to launch the project and then click on the top right button.

I hope you will bring me a solution,
Thank you,
Romain.

Hi Romain,


Thank you for sharing the sample project.

After an initial test we were able to replicate the JavaScript error as shown in the attached snapshot therefore we have logged this incident in our bug tracking system as CELLSNET-43942. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Hi,


Thanks for your answer,

I hope you will bring me a fix very soon. This issue is kind of annoying because it affects basic behaviour of the control…

Regards,
Romain.

Hi Romain,


Thank you for writing back.

I can understand the urgency of this matter, and therefore I have added a comment for the concerned member of the product team to schedule the aforesaid ticket for analysis at earliest possible. Unfortunately, we can not commit a resolution date unless we have thoroughly analyzed the scenario so we request you to please spare us little time and we will get back to you with updates in this regard.

Hi Babar,


Do you have any update about the issue ?

Thanks,

Romain.

Hi Romain,


I am afraid, we haven’t yet received any updates regarding the ticket logged earlier as CELLSNET-43942, however, I have raised the priority of the ticket and have requested the concerned member of the product team to share the analysis results at earliest possible. I will be keep checking with the team to bring you updates in this regard.

We are sorry for the inconvenience.

Hi again,

This is to inform you that we have completed the investigation on the problem logged earlier as CELLSNET-43942. Please note that the problem is caused due to the reason that you are clearing the WebWorksheet collection before importing the spreadsheet into the GridWeb component, that isn’t recommended. Please comment out the statement as follow and give the scenario another try.

C#

private void LoadData(string savePath)
{
// Clears datasheets first.
//GridWeb1.WebWorksheets.Clear();
// Imports from a excel file.
GridWeb1.WebWorksheets.ImportExcelFile(savePath);
}

Hi Babar,


Thank you for your answer,

Indeed if I comment this line there is no more javascript error.

However I’m affraid that the grid does not load correctly the new workbook. Actually, the top right button is used to load the @Rom2.xlsm workbook. But when you click on it, nothing happens…

Please try and let me know if you have the same issue.

Thanks,

Romain.

Hi Romain,


Thank you for the confirmation on previously reported issue. Regarding your recent concerns, I am afraid, I am not able to observe any problem. Please note, the button “Click here” calls the LoadData method that in turns refreshes the GridWeb control by reloading the spreadsheet. It is working fine on my side while using your previously shared project. In case you have amended the project since then, I would request you to create an archive of the project and share it here for further analysis.

The project has not been updated except the line GridWeb1.WebWorksheets.Clear(); that I have commented.


I attached you a video capture to show you that the workbook @Rom2.xlsm is not loaded when the “Click here” button is pressed.

Hi Romain,


Thank you for sharing the video. I am now able to see the problem that you are having on your side. Moreover, I am not able to observe the issue on my end because I am using the modified code to load the spreadsheet in GridWeb component as per product team’s recommendations. Please note that the WebWorksheets class will be removed from the public API with future releases of Aspose.Cells.GridWeb component. Therefore it is advised to use the GridWorksheetCollection class instead of WebWorksheets class. As GridWorksheetCollection class does not have an ImportExcelFile method so you should load the spreadsheet using the GridWeb.ImportExcelFile method instead.

The modified LoadData method will look like as follow.

C#

private void LoadData(string savePath)
{
// Imports from a excel file.
GridWeb1.ImportExcelFile(savePath);
}

Thank you very much, it works as expected

Hi,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with given code. Let us know if you encounter any other issue, we will be glad to look into it and help you further.