Not Able To Open Excel .xls Files Using The Oc4j Container (Doc ID 549117.1)

Last updated on JANUARY 22, 2008

Applies to:

Oracle Containers for J2EE - Version: 10.1.2.0.2
This problem can occur on any platform.

Symptoms

When executing the application and the request for the excel page is submitted,
the browser ask if user wants to either open or save the file.
But the file name is shown as   " valRpt?fp=082007 "
It is then selected to open, and an error is displayed:

" Microsoft Office Excel cannot access the file : https://host:port/dr/valRpt?fp=082007 "

The expected file name was valReport.xls

The page is produced by the following code:

// prepare workbook and get ready to process data
HSSFWorkbook workbook = ValidationReport.writeReport(locationNumber, financialPeriod);

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=valReport.xls");
response.setHeader("Cache-Control", "cache-response-directive=private");

OutputStream ostream = response.getOutputStream();
workbook.write(ostream);


When the file is placed under ORACLE_HOME/Apache/Apache/htdocs, and the file is accessed through
the browser, the excel page is correctly delivered and uploaded at the workstation. If it is accessed from oc4j container it gives error.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms