Which version of POI? Please try with the latest build from trunk, there have been updates to SXSSF lately.
If the problem is still there, we need more info to debug it: 1. post full code that we can use to reproduce the problem. 2. attach two files: one generated by SXSSF and the other 'fixed' by Excel. P.S. please don't cross-post to both poi-user and poi-dev. poi-user is the right place to ask questions. When the problem is detected and a Bugzilla ticker is created, you can track further progress in the poi-dev list. Yegor On Wed, Aug 17, 2011 at 12:14 AM, Shreyaswini <[email protected]> wrote: > hi, > > I have used SXSSF to create the excel with 2 sheets in it. For excel with 1 > sheet, it opens up properly without any problem. But with two sheets & with > large data (45k+ rows & 100+ columns) i get the following pop up while > opening the excel : "Excel found unreadable content in 'doc1.xlsx'.Do you > want to recover the contents of this workbook? if you trust the source of > this workbook,click Yes." if i click yes, the data is present in the sheets > but all the styles applied to the workbook is lost. > > SXSSFWorkbook workbook = new SXSSFWorkbook(DEFAULT_WINDOW_SIZE); > buildExcelDocument(model, workbook, request, response); > // Set the content type. > response.setContentType(getContentType()); > // Flush byte array to servlet output stream. > ServletOutputStream out = response.getOutputStream(); > workbook.write(out); > out.flush(); > > > protected void buildExcelDocument(Map<String, Object> model, > SXSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse > response) throws Exception { > > String excelSheetName = CommonUtil.getExcelNameForXssf(entityType, > entityName, Date); > response.reset(); > response.setHeader("Content-Disposition", excelSheetName); > > createSheet1(model, workbook); > > createSheet2(model, workbook); > > response.flushBuffer(); > } > > > Please help me to resolve this issue. > > Regards, > Shreya > > > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/problem-opening-excel-2007-created-using-SXSSF-tp4705686p4705686.html > Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
