eraianbanc Posted October 12, 2009 Share Posted October 12, 2009 Hi All,When i try to generate a report in XLS format, the zeros in the resultset after decimal point is not displayed when it is exported to xlsEg: Resultset123.0000123.2340In Excel report im getting these values as 123 123.23 .We use JExcelApiExporter for eporting it to excel in the below code.Please suggest me how to handle the decima precision in Excel.I have this field as Double object.Code:Connection objDbCon = null; Map mpDetailSp; JasperPrint print = null;try {mpDetailSp = new HashMap();mpDetailSp.put("A I Laing Id",new Integer ("1")); objDbCon = getConnectionProcess("SERVERNAME","employees","devuser","devuser12$");mpDetailSp.put(JRParameter.IS_IGNORE_PAGINATION, true);print = JasperFillManager.fillReport("D:\\iRepors3.5.1_WS\\1841006_1_0_1.jasper", mpDetailSp, objDbCon);JExcelApiExporter jExcelApiExporter = new JExcelApiExporter(); jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_AUTO_DETECT_CELL_TYPE,Boolean.TRUE);jExcelApiExporter.setParameter(JRExporterParameter.JASPER_PRINT, print); jExcelApiExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "D:\\iRepors3.5.1_WS\\TEST_DECIMAL_PRECISION.xls"); jExcelApiExporter.exportReport();catch(Exception objException) { objException.printStackTrace(); } finally { objDbCon.close(); objDbCon = null; } Link to comment Share on other sites More sharing options...
eraianbanc Posted October 13, 2009 Author Share Posted October 13, 2009 Can any one please help us in gettting those Zeros also after the decimal pont when exported as excel. Only when i export the fiels as Double, i ll be able to calculate the sum,avg and all in the excel cells.Do i need to set any other parameter, while exporting it to excel.??Rgds,Erai. Link to comment Share on other sites More sharing options...
prajakta_s_c_1 Posted February 27, 2013 Share Posted February 27, 2013 I am also facing the same problem. Rounding is happening properly if there digits after decimal point but in case the digits are 100.00 only 100 is displayed in Excel. Formatting using patterns works in PDF but not in Excel. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now