We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save Excel with picture in GridWeb

Hello,
I have been using Aspose.Gridweb for .net version 8.0.1.2000 in a VB.Net environment.

I am loading en excel file with a picture in one of the worksheets and when I press the submit button, I get the error:

Unable to cast object of type ‘Aspose.Cells.GridWeb.Data.Picture’ to type ‘System.Collections.SortedList’.

If I delete the picture from the file, I get no error and the file is saved correctly.

How can I save the file with the picture from GridWeb?

I am attaching the project and the excel file for you to have a look at.

Thanks

Hi Marinos,



Thanks for your posting and using Aspose.Cells for GridWeb.

We were able to observe this exception that occurs while saving the Excel file which contains picture in GridWeb.

We have tested this issue with the following code using the latest version: Aspose.Cells for GridWeb v8.1.2.2000.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-42879 - Exception on saving Excel with picture in GridWeb.

Please note, you should add acw_client directory inside your virtual directory in some folder. Suppose you add it in a directory named grid, then you should add the following app settings in your web.config file. These are needed so that GridWeb could work fine.


<add key=“aspose.cells.gridweb.acw_client_path” value=“grid/acw_client”/>





C#

string filePath = @“F:\Shak-Data-RW\Downloads\Book1.xlsx”;


GridWeb1.WebWorksheets.ImportExcelFile(filePath);

GridWeb1.WebWorksheets.SaveToExcelFile(filePath + “.out.xlsx”);

Exception:
[InvalidCastException: Unable to cast object of type 'Aspose.Cells.GridWeb.Data.Picture' to type 'System.Collections.SortedList'.]
   ›..(Object , WebWorksheets , Boolean , ˜ ) +5341
   Aspose.Cells.GridWeb.Data.WebWorksheets.SaveToExcelFile(String targetFile) +137
   TestGridWeb.Page_Load(Object sender, EventArgs e) in f:\Shak-Data-RW\Projects\AsposeProject\AsposeGridWeb\TestGridWeb.aspx.cs:32
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Hi Marinos,



Thanks for using Aspose.Cells for GridWeb.

We have fixed the issue. (CELLSNET-42879 - Exception on saving Excel with picture in GridWeb)

Please download and try the fix: Aspose.Cells for GridWeb v8.1.2.2001 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-42879) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

thanks. The issue has been solved with the fix

Hi Marinos,



Thanks for your feedback and using Aspose.Cells for GridWeb.

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