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_REPORT_CRITERIA);
break;
}
HSSFWorkbook wb = excel.getWorkbook();
String strName = excel.getReportName();
try {
OutputStream output = response.getOutputStream();
break;
}
HSSFWorkbook wb = excel.getWorkbook();
String strName = excel.getReportName();
try {
OutputStream output = response.getOutputStream();
// SET THE
MIME
TYPE
response.setContentType("application/vnd.ms-excel");
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());
// 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
