posted 18 years ago
Hi Young,
I need to display the summary of transactions in the excel sheet. I have tried with both POI and JXL to complete this functionality. Its working fine in my dev machine(Windows). But when i moved to the prod env (unix machine), its dispayed the data as shown below. My code goes as below:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment; filename=sampleName.xls");
//JXL
WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());
WritableSheet s = w.createSheet("Cards", 0);
s.addCell(new Label(0, 0, "columnValue"));
w.write();
w.close();
//POI
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("Cards");
HSSFRow row = sheet.createRow((short)0);
row.createCell((short)0).setCellValue("columnValue");
FileOutputStream fileOut = new FileOutputStream("cards.xls");
wb.write(fileOut);
fileOut.close();
I am creating the workbook by reading the data from the .csv file which is stored on the weblogic5.1 server.
Thanks and Regards,<br />Senthil