1. A report needs to be converted to excel format and send via SMTP as an attachment.
2. The report (all the values in the excel file) in the attached excel file should be in read-only format. Receiver of the mail should not be able to modify the data in that.
I have done with the first one. Can any one please help me in the second requirement.
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
If you are exporting the data to a CSV for excel, because you can't export to a real excel doc, you can't do anything to enforce read only of the file. It is just a text file which has no form of READONLY management beyond the filesystem. If they receive the file in an email and copy it to their hard drive, the file becomes owned by their userid on that system and they can do what they want with it.
since You are talking about a report
if Your organization really needs to send to a PC something read_only/readable/printable
it would be worth investigating PDF format
PDF's can be tagged with many protection attributes,
which should satisfy Your organization security needs
We can directly export data to real excel sheet using HTML tags embedded in the data and setting the content-type and content-disposition for the SMTP proc.
I have read in some forum (not sure, used Google search) formatting excel using mso-properties. One of such formatting is mso-protection which can be used in Excel to protect the contents. But not sure how to use it.
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
Then the document is not an excel document, but an HTML document. HTML files are just plain text, not binary. Text files have no mso-properties that can force read-only. Your requirement for read-only is unachievable with your current output format.