I would like to have a string value in a cell that maintains the leading and trailing spaces. If I set a String value in a cell with leading and trailing spaces, the value seems to be preserved in the XML, but does not display in Excel.
For example:
XSSFCell cell = row.createCell(0);
cell.setCellValue("   XYZ   ");

Yeilds <si><t> XYZ </t></si> in sharedStrings.xml but does not display the spaces in Excel.

If you just type the value in Excel you get
<si><t xml:space="preserve">    XYZ    </t></si>

How can I preserve these spaces using POI?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to