Generating Reports

Generating Reports

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.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.


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

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.