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.

Wed Mar 15, 2017 4:03 pm

Hello

I have a issue when I try to save to a image a xlsx file with functions.

Code: Select all
Workbook workbook = new Workbook();
             workbook.LoadFromFile(excelfilepath);
             Worksheet sheet = workbook.Worksheets[0];
             sheet.SaveToImage(1, 1, 36, 15).Save(excelfilepath.Replace(".xlsx", ".png"), ImageFormat.Png);


The problem it's that In the image do not appear the value of the cells with functions, only the default value 0 appears in this case.

Any solution or why its happening?

A cutout from the xlmx file with the funtions value
CutoutFromExcel.PNG
CutoutFromExcel.PNG (4.95 KiB) Viewed 2762 times


A cutout from the image file without the funtions value
CutoutFromImage.PNG
CutoutFromImage.PNG (5.93 KiB) Viewed 2762 times

Thanks

karont
 
Posts: 3
Joined: Wed Mar 15, 2017 3:42 pm

Thu Mar 16, 2017 2:21 am

Dear Alvaro Quesada,

Thanks for your inquiry.
After an initial test on a simple excel demo with function, the issue you mentioned didn't occur on my side. I suggest you first apply our latest version (Spire.XLS Pack Hotfix Version:7.11.59) to see if it works. If it still troubles you, please write bcak and provide your input xlsx file for an investigation.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Mar 16, 2017 12:59 pm

I try the hotfix and keep hapening

I forgot to metion that after load the file and before saving to an image, I insert data into the cells that the functions use to give the value.

Could be that i have to close the excel before saving to an image?

Thanks

karont
 
Posts: 3
Joined: Wed Mar 15, 2017 3:42 pm

Fri Mar 17, 2017 7:09 am

Hello,

I just followed your steps, but nothing went wrong on my side. Here's my code:
Code: Select all
 Workbook workbook = new Workbook();
            workbook.LoadFromFile(inputFile);
            Worksheet sheet = workbook.Worksheets[0];
            sheet.Rows[1].Cells[1].Value2=10;
            Image img=sheet.ToImage(1, 1, 6, 3);
            img.Save("imageName.png", ImageFormat.Png);

If I misunderstood your need or the issue still exists, please share us with your input file and code snippet so that we can give you a quick solution.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Mar 17, 2017 12:12 pm

I try the non-free version of Spire.xls and with the ToImage method it's working fine so I guess the problem is in the free version of Spire.xls and in the SavetoImage method.

The problem it's that i can't use the non-free version so I will have to find another solution.

Thanks for the replies

karont
 
Posts: 3
Joined: Wed Mar 15, 2017 3:42 pm

Mon Mar 20, 2017 1:31 am

Hello,

So sorry for the inconveniece caused by our free version.
If there's any doubt afterwards, welcome to get it back to us.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.XLS