View attachment on the web

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.

Subject: view attachment on the web

Hi Dena,I think you made it a bit too complex to achieve what you want. To use the printable form on the web, you could simple create a view with a form formula in it (this means that opening documents from this view will use this form for it).

In the browser you can then open it by using an url like: http://server/db.nsf/printview/uniquied/… and since all data is present in the document, the attachments should work as well.

Martin Vereecken

http://www.bizzybee.be

Subject: RE: view attachment on the web

I actually tried this first, but the rich text field would not inherit properly.

I think it may have been a setting on the form. I copied a form from another database which had working RTF’s on the web. Then, I slowly re-created the proper fields for the document I needed. It now works. I’m not sure what the form setting would have been.

Thanks to everyone for your help!

Subject: view attachment on the web

Subject: RE: view attachment on the web

Also check the type of your $V2AttachmentOptions field. Make sure, that there is no corresponding item saved in the documents.