Tip

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)
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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

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.