I have an application that is read only on the web. The users want to display the data differently on the web, so I have created a printable form. Because I need to display rich text fields, I am saving the printable form (it will be deleted automatically later).
On the printable form, I have a field $v2AttachmentOptions=“1”.
In the webqueryopen event on the main document, I running an agent which creates the printable document. Here is the simple code:
Dim doc As notesdocument
Dim s As New notessession
Dim db As notesdatabase
Dim docPrint As notesdocument
Dim itm As notesItem
Set doc=s.DocumentContext
Set db=s.CurrentDatabase
Set docPrint=db.CreateDocument
Call doc.CopyAllItems(docPrint, True)
docPrint.form="frmPrint"
docPrint.RemoveItem("Author")
Call docPrint.ComputeWithForm(True, False)
docPrint.SaveOptions="1"
Call docPrint.Save(True, False)
doc.PrintableDocID=docPrint.UniversalID
In the onLoad event I am opening the printable form. Here is the code:
var texturl
texturl=“/” + document.forms[0].dbname.value + “/0/” + document.forms[0].PrintableDocID.value + “?OpenDocument”;
window.close();
var newWindow=window.open(texturl);
newWindow.focus();
Everything works perfectly except the attachments can not be seen on the web. If I open the printable document through notes, I can see the attachments and they open properly.
The attachments are there on the web because this url will work:
http://www.server.com/db.nsf/0/unid/$File/Title.pdf
Any help you can provide would be appreciated.