poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhiraj Dixit" <dhiraj.di...@tatainfotech.com>
Subject Not able to open excel file
Date Fri, 23 Sep 2005 13:48:35 GMT
Hi all,

I m  trying to open  excel file in new window .What im doing is getting
workbook excel and paasinfg it into a blank jsp where i have wriiten a code
to open that workbook object .The code of that JSP is
---------------------------------------------------------------------------
excel=(ExcelVO)request.getAttribute(SessionConstants.SEARCH_NCM_SUMMARY_REPO
RT_CRITERIA);
       break;
   }
HSSFWorkbook wb = excel.getWorkbook();
String strName = excel.getReportName();
try {

 OutputStream output = response.getOutputStream();

 // SET THE MIME TYPE
 response.setContentType("application/vnd.ms-excel");

 // set content dispostion to attachment in
 // case the open/save dialog needs to appear
 response.setHeader("Content-disposition", "attachment; filename="+ strName
+".xls");
 wb.write(output);
 output.flush();
 output.close();
} catch (FileNotFoundException fne) {
 System.out.println("File not found...");
} catch (IOException ioe) {
- System.out.println("IOException..." + ioe.toString());
----------------------------------------------------------------------------
-------------------------------------------------

Now when im  able to save that file and view it properly but while when i go
"Open" option in dialogue box followuing errors come




Can anybody tell why this is happening .Please it's very urgent.



Thanks &Regards

Dhiraj  Dixit

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message