Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Dec 15, 2020 9:12 am

Good morning.

I am working with version 10.1.0 of FreeSpire.XLS and I have noticed that the SaveChartAsImage method only returns images up to the third sheet of the book. If I have charts from the fourth sheet, the method returns 0 elements. Is this an error or the behavior is as expected? I don't see sense in this version to create the sheets you want but this function only returns images of graphs only up to the third.

A greeting.

blastdoman
 
Posts: 27
Joined: Thu Jul 02, 2020 7:06 am

Tue Dec 15, 2020 11:35 am

Hello,

Thanks for your inquiry.
I tested the following code with Free Spire.XLS for .NET Version:10.10 but did not encounter the issue you mentioned. To help us investigate further, please provide your input file. Thanks in advance.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile("ChartSample.xlsx");
            foreach (Worksheet sheet in workbook.Worksheets)
            {
                for (int i = 0; i < sheet.Charts.Count; i++)
                {
                    Image image = workbook.SaveChartAsImage(sheet, i);
                    image.Save(sheet.Name + "-" + i + ".png", ImageFormat.Png);
                }
            }


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Dec 15, 2020 11:56 am

I have upgraded to version 10.10 and the problem is still happening. I've attached the input file although I don't know if you'll be able to open it so it's commented here https://www.e-iceblue.com/forum/error-loading-with-loadfromfile-t9790.html and the reason why the issue SPIREXLS-3002 was opened.

Thanks.
Attachments
rr30.zip
(274.2 KiB) Downloaded 157 times

blastdoman
 
Posts: 27
Joined: Thu Jul 02, 2020 7:06 am

Wed Dec 16, 2020 1:55 am

Hello,

Thanks for your response.
Unfortunately, I'm unable to open your file with our Spire.XLS. Are you testing another file? If so, please provide the appropriate file that could reproduce your issue to help us investigate further. You could send it to us (support@e-iceblue.com) via email. Thanks in advance.

Also, I have attached my input file for you to test, all charts in that file can be saved successfully.

Sincerely,
Rachel
E-iceblue support team
Attachments
InputFile.zip
(83.35 KiB) Downloaded 149 times
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS

cron