Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to write-protect an exported Crystal Report from VB6

Status
Not open for further replies.

polyquoter

Programmer
Feb 4, 2001
14
0
0
US
I'm exporting a Crystal Version 7 report into a rich text format. I'm doing this from VB6 so that the export can be e-mailed as an attachment. When you open this attached rich text (.rtf) file the top portion (the report header) is "greyed out" and cannot be changed. The rest of the file is in black print and can be changed. How can I get the entire .rtf file to be in this "grey mode" so it cannot be changed? If it can't all be "grey" how can I make it read only or write protected?
 
I don't think that this is protected.
You are probably opening it in MS Word, which stores the heading in the page header. I believe the "View" menu will give you access to the grey text.

I don't know of a way to write protect an RTF other than at the OS level. This will prevent them from saving changes, but not from printing a modified copy or saving under another name. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thank you for the information. I was afraid that it could not be write protected. Do you know what kind of an OS call I could make from VB6 to write protect this file before it is sent off in the E-mail?

My code currently is:

EmailQuot.DataFiles(0) = "C:\Vatc\quotprt.mdb"
EmailQuot.EMailSubject = mysubject.Text
EmailQuot.EMailToList = tolist.Text
EmailQuot.EMailCCList = cclist.Text
EmailQuot.EMailMessage = mymessage.Text
EmailQuot.Action = MESSAGE_SEND

My destination is to MAPI.
My Print To File PrintFileName is Quote and
PrintFileType is RTF.

Works great - I just need to keep people on the receiving end from altering the quote for a price - or at least make it hard for them to alter it.

Thanks in advance for any suggestions!
 
I don't know how to manipulate the DOS File properties from within VB. This would have to happen after the export. You might ask this in the VB Forum. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Have you considered sending the report as an image instead of an RTF file?

If you think about it, any media type you send can be manipulated if someone wants to do it. Heck, they can print it out and use white out to change the document and say the document was sent to them that way. There's only so much you can reasonably code for.

You may just want to keep an audit trail for research and "C.Y.A." purposes. I would recommend outputting the report to a write-protected file and just sending this file as an attachment. This way you know you both will have the same copy of the report and you can reference yours to verify that their claims are what you really sent them. This has worked like a charm for several of our programs.
 
Only way I can think is to export to DOC and use the Word APi to set a password for write access - the user can then only open as read only.
 
Exporting to PDF is suggested as one way to make a report Read Only, but I believe there are ways to edit PDF documents within Acrobat itself. But it is probably better than TXT

In the end any document is just a series of Bits in a message so they can be edited with an appropriate tool.

The safest solution would be to send them a rpt (which will have the saved data inside) but as they won't have your connection to the DB, they can look, but not touch. Use one of the many report viewers out there as a rpt file viewer. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top