Aspose.Excel issue - image files not showing up on all worksheets

Greetings!

We are using a super old version of Aspose.Excel (v 3.5.2.7) and having an issue with placing an image file in an Excel Workbook.

The code iterates through a block x number of times, creating 2 worksheets (Summary & Details) for each entity in the data set. The Summary worksheet should contain an image in the top left. Consistently, this image appears on the first worksheet in the workbook (the first Summary worksheet for the first entity in the data set) but then for every other Summary worksheet following the first one, there is a placeholder/box for the image with the words:

"This image cannot currently be displayed"

Below is the line of code that places the image:

base.Worksheet.Pictures.Add(3,1,_sRootPath + "myImage.png");

I have compared the image path for the iterations, and it is always identical to the initial one (in other words, the path is not changing from entity to entity).

I have also tried:
> Putting the image in the C root directory as well as an images directory and referencing it from there
> Adding the image at the end of the code block
> Using a for loop to insert the image into all the worksheets on the first iteration of the workbook
> Copying the image multiple times and referencing a new image for every worksheet
> Adding the image to the worksheet just before opening the file for the user
> Placing the image in a different location on the worksheet
> Changing the extension for the image from png to jpg
> adding the image to every single worksheet instead of just the Summary worksheets.

It seems to me like this may be a bug in the software, which very well may have been addressed in later versions.

One option I see for us is to upgrade to the latest version, which I believe would mean moving to Aspose.Cells. My question then is, if we do upgrade and I rewrite this piece of code to reference Aspose.Cells rather than Apose.Excel, is it going to break all the other code we have that references Aspose.Excel, or will the other code continue to reference the older version? I'd prefer not to have to rewrite all the code to fit to the newer version, just address this issue we are having with this one report.

Thank you!!!

Hi Kelli,

Thanks for your posting and considering Aspose.

Since, you are using quite an older version of Aspose.Cells, so it might be a bug in the old version. We strongly recommend you to upgrade your code and use the latest version of Aspose.Cells. There are many enhancements, bug fixes and new features added in Aspose.Cells over the years. So, you will encounter problems in upgrading your code. However, most of the changes you will encounter in Cell.Style property. In latest version, it has been replaced with Cell.GetStyle() and Cell.SetStyle() methods.

Please post your issues in upgrading the code in this forum to get help and quickly resolving your issues. We will look into your issues and provide you sample code at the earliest.

Thank you Shakeel for the prompt response.

Couple more questions for you.

1. To clarify, if we upgrade our current version of Aspose.Excel to Aspose.Cells, will we be able to maintain backward compatibility with the existing code (the code that works fine as is, no problems) or will we need to rewrite it to fit with Aspose.Cells?

2. We are using Aspose.Chart for this particular report, in addition to Aspose.Excel. If we upgrade to Aspose.Cells, would we need to upgrade to the latest version of Aspose.Chart as well?

Thanks!!

Kelli

Hi Kelli,

Thanks for your posting and considering Aspose.Cells.

Since, there are lot of enhancements and API changes since then, then you might have to re-write your application code because most of your existing code might not be backward compatible. We will suggest you to make a copy of your existing application and add reference to latest version and build the application. Then use this forum to get help in removing the errors and warnings generated by the build.

We strongly encourage you to upgrade your existing application with newer version because all bug fixes and enhancements are based on latest versions only. We do not fix bugs in older versions.

Aspose.Chart is now discontinued. For creating charts and getting their images, you can use Aspose.Cells. Aspose.Cells supports almost all MS-Excel charts.

For general help regarding Aspose.Cells and charts, please see the following documentation sub articles for your reference.