here is my code: Code: JExcelApiExporter exporter = new JExcelApiExporter(); ByteArrayOutputStream xlsReport = new ByteArrayOutputStream(); exporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT,jasperPrint); exporter.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM,xlsReport); exporter.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE); exporter.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.TRUE); exporter.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET,Boolean.TRUE); exporter.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE); exporter.exportReport(); InputStream inputStream = new ByteArrayInputStream(xlsReport.toByteArray()); HSSFWorkbook wb = new HSSFWorkbook(inputStream); short[] columns = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17}; short[] widthArray = {580 ,2124,1055,2322,1939,2375,2005,2045,1860,1939,2124,3799,4459,3694,1201,1201,3654,580}; int sheets = wb.getNumberOfSheets(); // Auto Fit nos Sheets for (int i = 0; i < sheets; i++) { HSSFSheet sheet = wb.getSheetAt(i); for (int j = 0; j < columns.length; j++) { sheet.setColumnWidth(columns[j], widthArray[j]); } } Post edited by: newtonarruda, at: 2007/07/06 18:16 Post edited by: newtonarruda, at: 2007/07/06 18:39