• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dhondiba Joshi
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ;-)
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic