How to open a ".odt" file in browser instead of download it?

Hello,

I'm trying to execute a jasper report that exports to odt (OpenOffice). The report is working fine, but when it opens, the browser asks if the user wants to open or to save the report. I want to open in the browser, like pdf. Is it possible?

I'm using this header:
resp.setHeader("Content-Disposition"," inline; filename=Report.odt");
                  //resp.setContentType("application/vnd.oasis.opendocument.text");
                  resp.setContentType("application/odt");
                  facadeReport.executeODT( out, reportCmd.getReport(),map );

Thanks...
LVL 1
arthur_infoAsked:
Who is Participating?
 
ICaldwellConnect With a Mentor Commented:
No, the open office does not have a reader interface like the Acrobat PDF reader, you will have to download the file to open it.....

The other solution would be to use an online viewer like this:  http://www.viewdocsonline.com/

Read the legal stuff before using this though....
0
 
CEHJCommented:
You'd need to have a browser plugin for that - not sure if one exists
0
 
chilternPCCommented:
if you download and install open office it will also install a plugin for the browser
see www.openoffice.org
0
 
arthur_infoAuthor Commented:
ok... Thanks...
0
 
chilternPCCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.