199 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Using Selectize for List Boxes and Combo Boxes in XPages
Fri, Jun 23rd 2017 136
Using SweetModal in XPages: Alert, Confirm, Prompt and Modal- Only Better!
Thu, Jun 22nd 2017 145
Using flatpickr a Lightweight and Powerful Datetime Picker in XPages
Wed, Jun 21st 2017 129
Replay IBM Notes Domino XPages Webinar - SmartNSF - 100% Smart - and in Color!
Tue, Jun 20th 2017 56
ApplicationInsights Quick Start Series
Tue, Jun 6th 2017 11
XPages Webinar: SmartNSF - 100% Smart - and in Color!
Mon, Jun 5th 2017 12
Domino and XPages Applications You Can Only Dream Of
Mon, Jun 5th 2017 10
Top 10
Using SweetModal in XPages: Alert, Confirm, Prompt and Modal- Only Better!
Thu, Jun 22nd 2017 145
Using Selectize for List Boxes and Combo Boxes in XPages
Fri, Jun 23rd 2017 136
Using flatpickr a Lightweight and Powerful Datetime Picker in XPages
Wed, Jun 21st 2017 129
Replay IBM Notes Domino XPages Webinar - SmartNSF - 100% Smart - and in Color!
Tue, Jun 20th 2017 56
IBM Domino and IBM Notes 9.0.1 FP7 available for download on IBM Fix Central
Tue, Sep 13th 2016 43
Using the Bootstrap 3 DateTime Picker Plugin including Moment.js and Locales in XPages
Wed, Jun 3rd 2015 22
IBM Notes Domino 9.0.1 Feature Pack 8 Preliminary Fix List and New Features
Sat, Jan 28th 2017 19
IBM Client Application Access 1.0.1 (ICAA) Enhancements
Sun, Jun 26th 2016 18
Notes Domino 9.0.2 and Notes Domino 9.0.1 Fix Pack 7
Sat, Jul 30th 2016 18
IBM Notes Domino 9.0.1 Fix Pack 5 Released
Mon, Nov 30th 2015 17


IBM Notes Tip: Export Data to Excel (CSV) using LotusScript Agents
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   


During the past period I received several questions how to export all Notes data corresponding to a specific Notes Form to Excel (CSV) using a LotusScript Agent. In the example below a possible solution to export all data associated with a specific Notes Form to Excel using a LotusScript agent. In the second example a possible solution to export all data from all forms in the Notes database to Excel using a LotusScript agent. For each form a separate Excel file will be created.

A. LotusScript Agent Export Data based on FormName

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
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
'Export Form
Dim fieldcount As Integer
Dim msgString As String        
If form.Name = "FORMNAME" Then          
fieldCount = 0
msgString = ""
fileNum% = FreeFile()
fileName$ = "c:tempexport" & form.Name & ".csv"
Open FileName$ For Output As fileNum%
ForAll Field In form.Fields
msgString = msgString & Chr(10) & _
"" & Field
fieldCount = fieldCount + 1
headerstring=headerstring & |"| &Field &|",|
End ForAll
Write #fileNum%,  |",| & headerstring & |"|
headerstring=""
Else
End If
End If
selection = |Form="| & form.Name & |"|
Set collection=db.Search(selection, Nothing, 0)
Dim newvalue As Variant
Set doc = collection.GetFirstDocument
Do Until (doc Is Nothing)
values=""
ForAll formfield In form.Fields
newvalue=doc.GetItemValue(formfield)
values=values & |"| & newvalue(0) & |",|
End ForAll
Write #fileNum%,  |",| & values &|"|
values=""
Set doc = collection.GetNextDocument(doc)
Loop
'Check Aliases
ForAll aliaz In form.Aliases
If aliaz = form.Name Then
GoTo NextAliaz   'alias is same as form name
End If
selection = |Form="| & aliaz & |"|
Set collection=db.Search(selection, Nothing, 0)
Set doc = collection.GetFirstDocument
Do Until (doc Is Nothing)
values=""
ForAll formfield In form.Fields
newvalue=doc.GetItemValue(formfield)
values=values & |"| & newvalue(0) & |",|
End ForAll
Write #fileNum%,  |",| & values &|"|
values=""
NextAliaz:
Set doc = collection.GetNextDocument(doc)
Loop
End ForAll
Close fileNum%
End ForAll
End Sub

B. LotusScript Agent Export Data All Forms in Notes Database

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
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
Dim fieldCount As Integer
Dim msgString As String
fieldCount = 0
msgString = ""
fileNum% = FreeFile()
fileName$ = "c:tempexport" & form.Name & ".csv"
Open FileName$ For Output As fileNum%
ForAll Field In form.Fields
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)
Dim newvalue As Variant
Set doc =collection.GetFirstDocument
Do Until (doc Is Nothing)
values=""
ForAll formfield In form.Fields
newvalue=doc.GetItemValue(formfield)
values=values & |"| & newvalue(0) & |",|
End ForAll
Write #fileNum%,  |",| & values &|"|
values=""
Set doc = collection.GetNextDocument(doc)
Loop
Close fileNum%
End ForAll
End Sub

---------------------
http://xpagesandmore.blogspot.com/2017/03/ibm-notes-tip-export-data-to-excel-csv.html
Mar 13, 2017
7 hits



Recent Blog Posts
136
Using Selectize for List Boxes and Combo Boxes in XPages
Fri, Jun 23rd 2017 9:37a   Johnny Oldenburger
Selectize is the hybrid of a textbox and box. It's jQuery based and it has autocomplete and native-feeling keyboard navigation; useful for tagging, contact lists, etc. It clocks in at around 7kb (gzipped). The goal is to provide a solid & usable user-experience with a clean and powerful API. Selectize is a lot like Chosen, Select2, and Tags Input but with a few advantages. In order to use Selectize, the JavaScript and CSS file(s) need to be included on the XPage / Custom Control. The lates
145
Using SweetModal in XPages: Alert, Confirm, Prompt and Modal- Only Better!
Thu, Jun 22nd 2017 12:50p   Johnny Oldenburger
One of the requirements for a new XPages Project constisted of a lightweight and powerful Confirm, Alert, Prompt and Modal functionality. In my search I came across SweetModal, a lightweight and powerful jQuey Plugin. In order to use SweetModal, the JavaScript and CSS file(s) need to be included on the XPage / Custom Control. The latest version can be downloaded from GitHub: SweetModal. Below a basic example how SweetModal can be used in an XPages application. Adding the JS and CSS files The Ja
129
Using flatpickr a Lightweight and Powerful Datetime Picker in XPages
Wed, Jun 21st 2017 12:30p   Johnny Oldenburger
One of the requirements for a new XPages Project constisted of a lightweight and powerful Datetime Picker functionality. In my search I came across flatpickr, a lightweight and powerful Datetime Picker. Lean, UX-driven, and extensible, yet it doesn’t depend on any libraries. There’s minimal UI but many themes. Rich, exposed APIs and event system make it suitable for any environment. In order to use flatpickr, the JavaScript and CSS file(s) need to be included on the XPage / Custom Control. T
56
Replay IBM Notes Domino XPages Webinar - SmartNSF - 100% Smart - and in Color!
Tue, Jun 20th 2017 6:15a   Johnny Oldenburger
On June 13 th a very interesting webinar was organized by T.L.C.C and Team Studio, SmartNSF - 100% Smart - and in Color! by Christian Guedeman and Martin Jinoch. For those who missed this webinar below the content, slides and video. Content SmartNSF is one piece of the IBM Domino application modernization puzzle! Learn how you can turn a simple Domino database (NSF) to a smart microservice within minutes. If you are new to the world of REST APIs, Microservices, OpenApi Specification and YAML do
11
ApplicationInsights Quick Start Series
Tue, Jun 6th 2017 5:31a   Johnny Oldenburger
Starting April 11, 2017, customers who are current on IBM Software Subscription and Support (S&S) for Domino Enterprise Server, Utility Server, or Dual Entitlement with Applications will be entitled to panagenda ApplicationInsights at no cost. See this blog post for important details pertaining to this offering. ApplicationInsights is an offering from panagenda that allows customers to get a detailed analysis of their application landscape in IBM Domino. ApplicationInsights provides key a
12
XPages Webinar: SmartNSF - 100% Smart - and in Color!
Mon, Jun 5th 2017 5:56p   Johnny Oldenburger
On Tuesday, June 13th (my Birthday) a very interesting webinar will be organized by T.L.C.C and Team Studio, SmartNSF - 100% Smart - and in color! by Christian Guedeman and Martin Jinoch. The registration for this webinar is available on the T.L.C.C website. Content Webinar SmartNSF is one piece of the IBM Domino application modernization puzzle! Learn how you can turn a simple Domino database (NSF) to a smart microservice within minutes. If you are new to the world of REST APIs, Microservices
10
Domino and XPages Applications You Can Only Dream Of
Mon, Jun 5th 2017 4:46p   Johnny Oldenburger
Great 'new' development products, tools and techniques continue to further develop and evolve within the IBM Notes Domino and XPages world. Some are free to use for others has to be paid. ClevaDesk is one of these amazing products which continues to evolve. ClevaDesk system expands IBM Notes Domino capabilities and gives it new life. There is no need to think about migrating to other technologies. ClevaDesk is a flexible IT-system with a set of business applications, a Designer to build IT-sys
10
Webinar Replay: Unlocking the Power of IBM Connections 6
Mon, Jun 5th 2017 4:28p   Johnny Oldenburger
On Wednesday, May 3 a very interesting webinar was organized by Maarga Systems, Unlocking the Power of IBM Connections 6.0. For those who missed this webinar below the content and the video. Content IBM has recently released the newest version of their Enterprise Collaboration Software – IBM Connections 6.0 that will bring new capabilities to Enterprise Social Networks for a simpler collaboration across the workforce and employee onboarding experience. IBM Connections 6.0 has new functionalit
6
Replay IBM Notes Domino XPages Webinar - Back from the Dead: When Bad Code Kills a Good Server
Tue, May 9th 2017 5:10a   Johnny Oldenburger
On May 2 a very interesting webinar was organized by T.L.C.C and Team Studio, Back from the Dead: When Bad Code Kills a Good Server by Bill Malchisky Jr. and Serdar Basegmez. For those who missed this webinar below the content, slides and video. Content It's Friday and a new customer calls. Their mission critical app is taking :05 to open documents and the users are quite concerned. Where do you start when handed a 20-year-old application you have never seen, on a server you barely know? Join
11
IBM Domino 9.0.1.Feature Pack 8 Interim Fix 3 Available for Download on IBM Fix Central
Sun, May 7th 2017 4:43p   Johnny Oldenburger
IBM Domino 9.0.1.Feature Pack 8 Interim Fix 3 is available for wownload on IBM Fix Central. Fix List updates in progress. Note: Domino 9.0.1 FP8 IF3 is a pre-req for Verse On-Premises 1.0.1. Download link: Interim Fix 2 for Domino 9.0.1 Feature Pack 8




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition