Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Fausto Leuci 17.Jul.09 11:47 AM a Web browser
General 6.0 All Platforms


A question:
i have an agent lotusscript that , given a db lotus, create a report csv (one file for each form in db) in which there all fields of form (one per column) and in each rows there is an element(document) of that forms.
each column contain in the header the name of field.
Example:

Field1; FIELD2; FIELD3;...

Instead I would like to have this:
field1(Type_of_field1);field2(Type_of_filed2);field3(Type_of_filed3);...

How could i take type of filed in a form?
There is not filed.type property.
when i take this:

Set rtitem=doc.GetNthElement(x);
Messagebox rtitem.type

i get a number (1024, 1028 etc), but i don't get "Text", "Rich Text" "Date" etc.
Could you give me a piece of code in which you show me how could i get name of field (only this i get for now) and corresponding type of field?
Thanks a lot!
My code is:
Sub Initialize

Dim session As New NotesSession
Dim db As NotesDatabase
Dim fileName As String
Dim fileNum As Integer
Dim headerstring As String
Dim values As String
Dim selection As String
Dim collection As NotesDocumentCollection
Dim doc As notesdocument
Dim tipoField As String
On Error Resume Next

Set db = session.CurrentDatabase

Forall form In db.Forms
If Isempty(form.Fields) Then
Messagebox form.Name & " has no fields"
Else

fieldCount = 0
msgString = ""
fileNum% = Freefile()
fileName$ ="D:\ExportDBsLotus\DES_Storico\" & form.Name & ".csv"
Open FileName$ For Output As fileNum%

Forall field In form.Fields
tipoField =form.GetFieldType(field)
msgString = msgString & Chr(10) & _
" " & field
fieldCount = fieldCount + 1
headerstring=headerstring & |"| & field & |";|

End Forall

Write #fileNum%, |";| & headerstring & |"|
headerstring=""
End If

selection = |Form="| & form.Name & |"|
Set collection=db.Search(selection,Nothing, 0)

For x = 1 To collection.count
Set doc =collection.GetNthDocument(x)
values=""
Forall formfield In form.Fields
newvalue=doc.GetItemValue(formfield)
values=values & |"| & newvalue(0) & |";|
End Forall

Write #fileNum%, |";| & values &|"|
values=""
Next

'controllo aliases
If Isempty(form.Aliases) Then
Else
Forall aliaz In form.Aliases
If aliaz = form.Name Then
Msgbox aliaz + " is same as " + form.Name
Goto NextAliaz 'alias uguale a nome form
End If
selection = |Form="| & aliaz & |"|
Set collection=db.Search(selection, Nothing, 0)

For x = 1 To collection.count
Set doc =collection.GetNthDocument(x)
values=""
Forall formfield In form.Fields
newvalue=doc.GetItemValue(formfield)
values=values & |"| & newvalue(0) & |";|
End Forall

Write #fileNum%, |";| & values &|"|
values=""
NextAliaz:
Next
End Forall
End If

Close fileNum%
End Forall

End Sub






Get fields type. (Fausto Leuci 17.Jul.09)
. . RE: Get fields type. (Paul K Smerdon 17.Jul.09)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM Web Content Manager
Lotus Domino Document Manager
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow