Dont work xlsx for russian windows regional settings

Feb 24, 2014 at 12:53 PM
Edited Feb 25, 2014 at 3:55 AM
Dont work xlsx for russian windows regional settings
Probably blame decimal separator
You must use XmlConvert before recording a numerical value

You create an invalid xml
<?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="A1"></dimension>
   <sheetViews>
      <sheetView tabSelected="1" showRuler="1" showOutlineSymbols="1" defaultGridColor="1" colorId="64" zoomScale="100" workbookViewId="0"></sheetView>
   </sheetViews>
   <sheetFormatPr defaultRowHeight="15"></sheetFormatPr>
   <sheetData></sheetData>
   <pageMargins left="0,7" right="0,7" top="0,75" bottom="0,75" header="0,3" footer="0,3"></pageMargins>
</worksheet>
Mar 6, 2014 at 11:40 AM
this is fixed in the most recent code on github.

The last issue I found was in SetCellValue in the XSSF namespace
        public void SetCellValue(double value)
        {
      //...
            else
            {
                _cell.t = (ST_CellType.n);
                // fixed for any culture
                _cell.v = (value.ToString(CultureInfo.InvariantCulture));
            }
        }
Using the current NPOI code + this fix your XML files should always be generated correctly.
Coordinator
Mar 9, 2014 at 7:16 PM
which version are you using? I need to track the issue impact
Mar 10, 2014 at 6:10 AM
Coordinator
Mar 13, 2014 at 8:10 PM
try the latest github source code and let me know if it's fixed.
Mar 15, 2014 at 2:22 PM
Hi, sorry my english

Workbook created OK
I try write decimal value- error <v>1,5</v>

IWorkbook workbook = new XSSFWorkbook();
ISheet sheet = workbook.CreateSheet("Sheet1");
sheet.CreateRow(1).CreateCell(1).SetCellValue(1.5);
FileStream sw = File.Create("test.xlsx");
workbook.Write(sw);
sw.Close();

<?xml version="1.0"?>
<worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<dimension ref="A1" />
<sheetViews>
<sheetView tabSelected="true" workbookViewId="0" />
</sheetViews>
<sheetFormatPr defaultRowHeight="15" />
<sheetData>
<row r="2">
<c r="B2">
<v>1,5</v>
</c>
</row>
</sheetData>
<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />
</worksheet>


2014-03-14 0:10 GMT+04:00 tonyqus <[email removed]>:

From: tonyqus

try the latest github source code and let me know if it's fixed.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com