1. Make a principal form ?- PrintPreview which show as the report and the headtable less the content of the table. It must contain a field Body ? rich text.
2. Make a secondary form -- PrintItem ?- which contains a table line (the upper) with the field from the documents that wil be show in the table
3. Make an reezi agent which will generate the document collection and after through changing of form with PrintItem and with the operation operatiunea RenderToRTItem in the Body field (rich text) from the form PrintPreview, it will generate the document with the desired report.
4. A view with form selection PrintPreview and a button for Generating reports with the Agent Report.
The Agent Report:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim ws As New notesuiworkspace
Set db=session.CurrentDatabase
Dim collection As NotesDocumentCollection
Dim dateTime As New NotesDateTime( "12/01/94" )
d$=Inputbox("Introduceti data in format 22.09.2000")
user$=session.CommonUsername
sir$= user$
'main script
Dim docPrintPreview As notesdocument
Dim success As Variant
Dim rtitem As notesrichtextitem
Dim previewUiDoc As notesuidocument
Dim doc As notesdocument
Set collection = db.FTSearch( sir$ , 0 )
If collection.count>0 Then
count%=1
Set docPrintPreview = New NotesDocument(db)
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
Set rtitem=New notesrichtextitem(docPrintPreview, "body")
docPrintPreview.Form="PrintPreview"
docPrintPreview.Subject="Subject "& titlu$ & " Date: " & d$
docPrintPreview.SubTitle=""
Call docPrintPreview.Save(True, True)
For j=1 To collection.count
Set doc=collection.GetNthDocument(j)
doc.c=count%
doc.Form="PrintItem"
Call doc.RenderToRTItem(rtitem)
count%=count%+1
Next
Call docPrintPreview.Save(True, True)
End If
End Sub
This was first published in March 2001