I am trying to generate excel file using various currencies.
This works fine
public HSSFCellStyle moneyStyle;
SSFDataFormat format = excelUtils.wb.createDataFormat();
moneyStyle = excelUtils.wb.createCellStyle();
moneyStyle.setDataFormat(format.getFormat("$##,###,###,###,##0"));
However if i change the $ to INR (Indian Rupees) it will not work.
public HSSFCellStyle moneyStyle;
SSFDataFormat format = excelUtils.wb.createDataFormat();
moneyStyle = excelUtils.wb.createCellStyle();
moneyStyle.setDataFormat(format.getFormat("INR##,###,###,###,##0"));
In the Excel spreadsheet the INR does not show up but ‘$’ or ‘A$’ works just fine
Any help will be appreciated.
That is not a valid excel format. If you want to do this you need to either surround
INRin double quotes or\before each character.The format you are using would not work if set directly in Excel either.
I believe either should work, though I have only tested directly in Excel.