Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

New Post: [NPOI.XSSF.UserModel] XLSX file : repair needed when using Double in SetCellValue()

$
0
0
I faced the same problem and narrowed it down a bit.

On my German system with German culture info (i.e. comma as decimal separator), the XML files will be corrupt, regardless of the data type I am trying to write. Diff-ing the worksheet files revealed that this has to do with the basic sheet info being written at the end of the worksheets XML. The code generated on a German machine will be
<pageMargins left="0,7" right="0,7" top="0,75" bottom="0,75" header="0,3" footer="0,3"></pageMargins></worksheet> 
instead of
<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"></pageMargins></worksheet> 
Obviously this will throw an error with OpenOffice or Excel.

So I will use a forced US culture info for writing the data streams. This should take care of all file stream issues.

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>