aspose file tools*
The moose likes JSP and the fly likes How to make an excel sheet rendered on browser read only? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to make an excel sheet rendered on browser read only?" Watch "How to make an excel sheet rendered on browser read only?" New topic
Author

How to make an excel sheet rendered on browser read only?

Dhondiba Joshi
Ranch Hand

Joined: Jan 23, 2004
Posts: 39
Hi everyone!
i am setting content type of my response to excel and displaying a report on browser . How to make this report sheet read-only ? Code below:
res.setContentType("application/msexcel");
res.setHeader("Content-Disposition", "inline;filename=report.xls");
ServletOutputStream out = res.getOutputStream();
out.println(xlsDoc.toString());
Please help its urgent ;-)


SCJP,SCWCD
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you can't.
If you know the Excel codes to make it readonly and insert those into the data at the correct positiont that should work but won't prevent the users from setting it back to write-enabled.
Of course it doesn't really matter as the data will not be stored into your datastore, if the users save the data it's to their own machines.


42
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
If you're looking to send something read-only back to the client, try rendering a PDF document. That's what most people do when generating quotes and the like online.
Originally posted by Jeroen Wenting:
you can't.
If you know the Excel codes to make it readonly and insert those into the data at the correct positiont that should work but won't prevent the users from setting it back to write-enabled.
Of course it doesn't really matter as the data will not be stored into your datastore, if the users save the data it's to their own machines.


James Carman, President<br />Carman Consulting, Inc.
 
Don't get me started about those stupid light bulbs.
 
subject: How to make an excel sheet rendered on browser read only?