GridWeb: Serializable error when trying to import an xls file with embedded picture

Hi,
I’m trying to use GridWeb1.WebWorksheets.ImportExcelFile(docURL); to import an xls file into my GridWeb. If the file contains an embedded picture, I get the following error:

Type ‘System.Drawing.Imaging.ImageFormat’ in Assembly ‘System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ is not marked as serializable.

The complete error log is attached.

Any suggestions?

Thanks

Jim

PS: The xls file I am trying to import was actually created using Aspose Cells for .Net

Hi,

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

Please download and use the latest version:
Aspose.Cells
for GridWeb v2.7.5.2002

and see if it works fine with your issue.

If the problem still occurs, then please provide us your source xls file (which you are trying to import and generated by Aspose.Cells as you mentioned.).

We will look into your issue and help you asap.

I have attached the xls that contains the image (on the 1st worksheet).
Jim

Hi,

I have tested your file with the latest version:
Aspose.Cells
for GridWeb v2.7.5.2002
and found it is working fine. I have attached the screenshot for your reference.

I have also attached the test gridweb project so that you can run and test this issue at your end. Please download it and try: ProjectGridWeb.zip

C#


string filepath = @“F:\Shak-Data-RW\Downloads\Incident+Management+(V3)±+03May2012-1139-13(1).xls”;


GridWeb1.WebWorksheets.ImportExcelFile(filepath);


Screenshot:

Hi,

Been off for a week’s vacation.
I tried your project and it does not give the serializable error, however it does render 2 images instead of 1, plus, if you click on another worksheet tab and then return to the Cover worksheet, the number of images is increased by 2. See the attached screenshot.

Regarding my initial error (serializbale), I tried placing my code in its own class and marked it as Serializable, but without any luck.
I have attached this class as well.

Any suggestions for what to try next?

Thankw

Jim

Hi,

Please place your code inside the condition that check if it is a postback or not.

Please see the following code and let me know if it works fine. I have checked at my end and images do not repeat after activating or deactivating the image sheet.

C#


if (Page.IsPostBack == false)
{

//Place your code inside this block

}

Serializable Issue

For your mentioned serializable issue, we will look into it. I have therefore logged serilizable issue in our database. Development team will investigate it and once it is fixed or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-40675.

Hi,

We have looked into your issue but we could not replicate the serializable issue at our end.

Could you please provide us a sample project after removing any extra/unneeded but simpler code that could replicate the serializable issue?

We will look into it and help you asap.