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 Jan 08, 2025 3:12 pm

We have Spire.Office licence, and we updated the last version (9.10.0 -> 9.11.0 and 9.12.0) But there is a problem with generated XLSX (at version 9.11.0 and 9.12.0 ):
Code: Select all
           
            Workbook workbook = new();
            // wrong excel
            Worksheet sheet = workbook.Worksheets[0];
            sheet.Range["A2"].Value = "1234.56";
            workbook.SaveToFile(@"c:\temp\test1.xlsx", ExcelVersion.Version2013);

            workbook = new();
            // wrong excel format
            sheet = workbook.Worksheets[0];
            sheet.Range["A2"].NumberValue = 1234.567;
            sheet.Range["A2"].NumberFormat = "0.00";
            workbook.SaveToFile(@"c:\temp\test2.xlsx", ExcelVersion.Version2013);
           
            workbook = new();
            // good excel format
            sheet = workbook.Worksheets[0];
            sheet.Range["A2"].NumberValue = 11;
            sheet.Range["A2"].NumberFormat = "0";
            workbook.SaveToFile(@"c:\temp\test3.xlsx", ExcelVersion.Version2013);

excel_error.png
excel_error.png (6.79 KiB) Viewed 67 times


Could you check it? And repair it?
Thanks:
Attila Farkas
Attachments
tests.zip
Tests
(17.2 KiB) Downloaded 480 times

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Wed Jan 08, 2025 8:49 pm

Ok, some help for you: I see in the generetated "bad" excel files, and the problem is the value with "," and not "." (see red value)

<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A2:A2" /><sheetViews><sheetView tabSelected="1" workbookViewId="0" topLeftCell="A1" /></sheetViews><sheetFormatPr defaultColWidth="9.28515625" defaultRowHeight="12.75" /><sheetData><row r="2" ht="12.75"><c r="A2" s="1"><v>1234,567</v></c></row></sheetData><printOptions /><pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><pageSetup orientation="portrait" paperSize="9" /></worksheet>

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Thu Jan 09, 2025 6:50 am

Hello,

Thanks for your inquiry. I tested your code with spire.office 9.12.0 in target Framework v4.6 project, but I did not encounter the issue. The result document can be opened normally and the XML data is correct.
xml.png
xml.png (24.02 KiB) Viewed 53 times

I have uploaded my exe program here. You can run it directly to see if there are any issues. If the issue only occurs in your project. Please provide the following more information to have a further investigation.
1. Your project framework version.
2. Your system information (E.g. Win10, 64 bit) and region setting (E.g. China, Chinese).

Sincerely,
Lisa
E-iceblue support team
Attachments
exeDemo.zip
(7.26 MiB) Downloaded 557 times
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Thu Jan 09, 2025 7:13 am

Hi Lisa,
thank you for your answer!
I downloaded your test program and ran it. Your program generates same incorrect excels. :-( I attached them.
wrong_excels.png
wrong_excels.png (16.68 KiB) Viewed 51 times


I have Windows 10 Pro operating system, 64 bit.
And Hungarian region.

Thanks,
Attila Farkas
Attachments
incorrect_excels.zip
(20.33 KiB) Downloaded 410 times

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Thu Jan 09, 2025 7:30 am

and I checked with both language settings (Hungarian/English) and the results are same incorrects (with your program)
office_language.png
office_language.png (29.23 KiB) Viewed 48 times

Thanks,
F.A.

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Thu Jan 09, 2025 10:07 am

Ok, +1 test: I changed regional format of the windows (from Hungarian to English (Europe)), and it works: your program generated good excels
angol_windows.png
angol_windows.png (205.31 KiB) Viewed 41 times

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Thu Jan 09, 2025 10:32 am

Hello,

Thank you for your further feedback. Yes, when I changed the computer's regional language to "Hungarian", I did reproduce this issue. I have logged this issue with the number SPIREXLS-5674 to our bug fixing system, we will notify you once it is fixed.
Currently, you also can add the following code setting to change area before the code, this cloud work on my side.
Code: Select all
       Thread.CurrentThread.CurrentCulture = new CultureInfo("en-EN", false);
       Workbook workbook = new Workbook();


Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Thu Jan 09, 2025 11:14 am

Dear Lisa,
Thank you very much! (We downgraded and using the 9.10.0 version)
Attila Farkas

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Fri Jan 10, 2025 1:31 am

Hello,

Sorry for the inconvenience caused. Our Dev team is working urgently to fix this issue, once it is resolved, we will provide you with the corresponding hotfix version as soon as possible.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Thu Feb 20, 2025 10:22 am

Hello,

Thank you for your patience.
Glad to inform that we just released Spire.XLS Pack(Hotfix) Version:15.2.3 which fixed SPIREXLS-5674, welcome to test it.
Website: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget link:https://www.nuget.org/packages/Spire.XLS/15.2.3

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Tue Mar 18, 2025 6:49 am

Dear Lisa,
thank you very much! It works!
Best regards,
Attila Farkas

dunaiceblue
 
Posts: 15
Joined: Wed Nov 16, 2022 7:20 am

Return to Spire.XLS

cron