• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ;-)
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic