199 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Using jQuery-Confirm a Multipurpose Plugin for Alert, Confirm and Dialog with Extended Features in XPages
Thu, Jul 27th 2017 7
Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages
Fri, Jul 21st 2017 10
IBM Notes Domino 9.0.1 Feature Pack 9 Preliminary Release Notice
Thu, Jul 20th 2017 8
Using Vex - Beautiful Functional Dialogs in Vanilla JavaScript in XPages
Wed, Jul 19th 2017 6
Using iziModal An Elegant, Responsive, Flexible and Lightweight Modal Plugin in XPages
Fri, Jul 7th 2017 6
IBM Sametime 9.0.1 FP1 Available for Download on IBM Fix Central
Thu, Jul 6th 2017 10
Using Selectize for List Boxes and Combo Boxes in XPages
Fri, Jun 23rd 2017 3
Top 10
IBM Domino and IBM Notes 9.0.1 FP7 available for download on IBM Fix Central
Tue, Sep 13th 2016 29
IBM Notes Domino 9.0.1 Feature Pack 8 Preliminary Fix List and New Features
Sat, Jan 28th 2017 18
Using Bootstrap Dual Listbox a Responsive Dual Listbox Widget in XPages
Wed, Oct 12th 2016 16
Using the Bootstrap 3 DateTime Picker Plugin including Moment.js and Locales in XPages
Wed, Jun 3rd 2015 15
Bootstrap Plugins in XPages Part III - Dialog Boxes using Bootbox
Sun, Apr 3rd 2016 14
Notes Domino 9.0.2 and Notes Domino 9.0.1 Fix Pack 7
Sat, Jul 30th 2016 10
IBM Sametime 9.0.1 FP1 Available for Download on IBM Fix Central
Thu, Jul 6th 2017 10
Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages
Fri, Jul 21st 2017 10
IBM Notes Domino 9.0.1 Fix Pack 5 Released
Mon, Nov 30th 2015 9
Bootstrap Plugins in XPages Part IV - Awesome Bootstrap Checkbox
Mon, Apr 4th 2016 9


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
1 hits



Recent Blog Posts
7
Using jQuery-Confirm a Multipurpose Plugin for Alert, Confirm and Dialog with Extended Features in XPages
Thu, Jul 27th 2017 4:16p   Johnny Oldenburger
In my continuous search for modern plugins for my XPages applications I came across jquery-confirm, a good alternative for iziToast (see my previous blog post Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages). jquery-confirm is a multipurpose plugin for alert, confirm and dialogs with Extended features. jquery-confirm is easy to use, highly flexible and provides a great set of features like, Auto-close, Ajax-loading, Themes, Animations and more. This
10
Using iziToast an Elegant, Responsive, Flexible and Lightweight Notification Plugin in XPages
Fri, Jul 21st 2017 10:32a   Johnny Oldenburger
After the implementation of iziModal in a new XPages application, see my previous blog post 'Using iziModal An Elegant, Responsive, Flexible and Lightweight Modal Plugin in XPages', I also chose a modern notification plugin for this XPages application, IziToast. iziToast is an legant, responsive, flexible and lightweight notification plugin with no dependencies. All modern browsers are supported (Tested in Chrome, Firefox, Opera, Safari, IE10+ and Edge). In order to use iziToast, the JavaScrip
8
IBM Notes Domino 9.0.1 Feature Pack 9 Preliminary Release Notice
Thu, Jul 20th 2017 9:56p   Johnny Oldenburger
Beginning with 9.0.1 FP8, fix packs have been renamed to feature packs. To ensure quality, these feature packs still have a high focus on addressing high impacting defects. Where possible, these features are optionally enabled to minimize risk. The same packaging, architecture and install kits used in previous fix packs remain in use for feature packs. Notes®/Domino® 9.0.1 Feature Pack 9 addresses defects in the Client, Server, and the Domino OpenSocial component. All Feature Packs are langua
6
Using Vex - Beautiful Functional Dialogs in Vanilla JavaScript in XPages
Wed, Jul 19th 2017 12:42p   Johnny Oldenburger
In my continuous search for modern plugins for my XPages applications I came across Vex. Vex is a modern dialog library which is highly configurable, easily stylable, and gets out of the way. Vex is tiny (5.5kb minified and gzipped), has a clear and simple API, works on mobile devices, and can be customized to match your style in seconds. Features Drop-in replacement for alert, confirm, and prompt Easily configurable animations which are smooth as butter Lightweight with no external dependencie
6
Using iziModal An Elegant, Responsive, Flexible and Lightweight Modal Plugin in XPages
Fri, Jul 7th 2017 1:30p   Johnny Oldenburger
In my search for modern plugins for my XPages applications I came across iziModal. iziModal is an elegant, responsive, flexible and lightweight Modal Plugin. In order to use iziModal, the JavaScript and CSS file(s) need to be included on the XPage / Custom Control. The latest version can be downloaded from GitHub: iziModal. Below a basic example how iziModal can be used in an XPages application. Adding the JS and CSS files The JavaScript and CSS files must be added to the WebContent Folder in t
10
IBM Sametime 9.0.1 FP1 Available for Download on IBM Fix Central
Thu, Jul 6th 2017 6:16a   Johnny Oldenburger
IBM Sametime 9.0.1 FP1 release is available. All customers are recommended to upgrade to this release. Update IBM Sametime V9.0 and V9.0.1 servers to Feature Pack 1 by downloading packages provided here in Fix Central and installing with the Update option. You can also use these 9.0.1 FP1 builds for a fresh install of servers and clients. It resolves a number of issues. Form more details: IBM Sametime 9.0.1 FP1 release - June 2017 Read the documentation on how to upgrade to 9.0.1 FP1 here: IBM S
3
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
4
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
6
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
4
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




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