// Need to do this, as we don't handle
// all the possible entries yet
CTStylesheet styleSheet = doc.getStyleSheet();
// Formats
CTNumFmts formats = CTNumFmts.Factory.newInstance();
formats.setCount(numberFormats.size());
for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
CTNumFmt ctFmt = formats.addNewNumFmt();
ctFmt.setNumFmtId(fmt.getKey());
ctFmt.setFormatCode(fmt.getValue());
}
styleSheet.setNumFmts(formats);