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.

Mon Jan 17, 2022 1:18 pm

Hello,

I'd like to use the Spire Free Java Package to convert an excel sheet to pdf.
The Problem is, that a cell with the content "=SUM(K5+K7+K9+K11)" does contain a wrong value in the exported file.

My Java code is as follows:

Code: Select all
Workbook workbook = new Workbook();
workbook.loadFromFile(fileName);
Worksheet sheet = null;
if(type == SheetType.DRIV) sheet = workbook.getWorksheets().get("Spesenblatt DRIV");
if(type == SheetType.RIV_NRW) sheet = workbook.getWorksheets().get("Spesenblatt RIV NRW");

sheet.saveToPdf("file.pdf");


The expected value for the cell with sample data is 62 the actual value in the exported file is 620.

I guess its a bug where the actual value is added in front of the initial cell value of 0 but I dont know how to fix this.

lwissenberg
 
Posts: 2
Joined: Mon Jan 17, 2022 1:08 pm

Tue Jan 18, 2022 1:47 am

Hello,

Thanks for your inquiry!

I recommend that you can use workbook.getConverterSetting().isReCalculateOnConvert(false); to avoid calculating the formula during converting the Excel file to PDF first. If the issue still exists after using that, please provide us with your input file for further investigate, you can also send it to us via email(support@e-iceblue.com). Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Jan 18, 2022 8:41 am

This indeed fixes the issue;
Thank you

lwissenberg
 
Posts: 2
Joined: Mon Jan 17, 2022 1:08 pm

Tue Jan 18, 2022 8:49 am

Hello,

Thanks for your feedback!

Glad to hear that the code is worked. If you encounter any issues related to our product in the future, just feel free to contact us.

Have a nice day!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.XLS