193 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
SSJS Editor intermittently fails to open in Domino Designer 9.0.1 Feature Pack 8
Fri, Mar 17th 2017 77
IBM New Way to Learn 2017 - Installing Browser Dependencies in XPages Applications
Tue, Mar 14th 2017 31
IBM Presents the IBM Notes Domino Roadmap and a Deep Dive into Feature Pack 8
Tue, Mar 14th 2017 43
XPages Tip: Hide Elements from Printing on an XPage using CSS
Tue, Mar 14th 2017 22
IBM Notes Tip: Export Data to Excel (CSV) using LotusScript Agents
Mon, Mar 13th 2017 13
IBM Open Mic Webcast: IBM Domino Application Development Update
Mon, Mar 13th 2017 12
IBM Notes Domino Feature Pack 8 Available for Download from IBM Fix Central
Tue, Mar 7th 2017 13
Top 10
SSJS Editor intermittently fails to open in Domino Designer 9.0.1 Feature Pack 8
Fri, Mar 17th 2017 77
IBM Domino and IBM Notes 9.0.1 FP7 available for download on IBM Fix Central
Tue, Sep 13th 2016 54
IBM Presents the IBM Notes Domino Roadmap and a Deep Dive into Feature Pack 8
Tue, Mar 14th 2017 43
Using the Bootstrap 3 DateTime Picker Plugin including Moment.js and Locales in XPages
Wed, Jun 3rd 2015 34
IBM New Way to Learn 2017 - Installing Browser Dependencies in XPages Applications
Tue, Mar 14th 2017 31
XPages Tip: Hide Elements from Printing on an XPage using CSS
Tue, Mar 14th 2017 22
IBM Notes Domino 9.0.1 Feature Pack 8 Preliminary Fix List and New Features
Sat, Jan 28th 2017 20
IBM Notes Domino 9.0.1 Fix Pack 5 Released
Mon, Nov 30th 2015 19
IBM Client Application Access 1.0.1 (ICAA) Enhancements
Sun, Jun 26th 2016 15
Notes Domino 9.0.2 and Notes Domino 9.0.1 Fix Pack 7
Sat, Jul 30th 2016 14


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



Recent Blog Posts
77
SSJS Editor intermittently fails to open in Domino Designer 9.0.1 Feature Pack 8
Fri, Mar 17th 2017 5:48p   Johnny Oldenburger
In case you missed it, there is a problem in the Domino Designer after installing Feature Pack 8. Below the description of IBM Support. An intermittent problem has been introduced in Domino Designer 9.0.1 Feature Pack 8 that causes a failure when opening the SSJS editor. This problem affects only applications that contain a managed bean. This issue is being tracked as SPR LHEYAKBJSQ. As a workaround, users can perform a full clean/rebuild of the application and then use the SSJS editor. Note: T
31
IBM New Way to Learn 2017 - Installing Browser Dependencies in XPages Applications
Tue, Mar 14th 2017 6:59p   Johnny Oldenburger
New Way to Learn is a comprehensive program of enablement for IBM Business Partners to get the skills and experience they need to be successful delivering, supporting and designing solutions on IBM's Collaboration Solutions platforms. Last year I participated as an IBM Champion to this great IBM program with a webinar on Bootstrap Plugins in XPages. This year I will return with a session on installing browser dependencies in XPages Applications using Node, Git Source Tree and bower / bower inst
43
IBM Presents the IBM Notes Domino Roadmap and a Deep Dive into Feature Pack 8
Tue, Mar 14th 2017 6:55p   Johnny Oldenburger
On March 28th a very interesting webinar will be organized by T.L.C.C and Team Studio, IBM Presents the Notes/Domino Roadmap and a Deep Dive into Feature Pack 8, by Barry Rosen (IBM), Adam Kesner (IBM), Martin Donnelly (IBM) and Brian Gleeson (IBM). The registration for this webinar is not yet available on the T.L.C.C website. Content Webinar Join us as IBM presents the plan for IBM Notes and Domino. This webinar will encompass two sessions presented at IBM Connect 2017! Adam Kesner and Barry
22
XPages Tip: Hide Elements from Printing on an XPage using CSS
Tue, Mar 14th 2017 6:37p   Johnny Oldenburger
For an XPages project I was asked whether it was possible to print only the viewPanel on an XPage and not all other elements such as an iframe and a widgetContainer by making use of a print button with a simple window.print() function. A good practice in this case is to use a style sheet specifically for printing and and set it's media attribute to print. Using the CSS @media rule it is very easy to initially add a class 'no-print' with display:none !important. This class can then be used
14
IBM Notes Tip: Export Data to Excel (CSV) using LotusScript Agents
Mon, Mar 13th 2017 9:55a   Johnny Oldenburger
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 A
12
IBM Open Mic Webcast: IBM Domino Application Development Update
Mon, Mar 13th 2017 6:17a   Johnny Oldenburger
On March 21 there will be a webcast about the IBM Domino Application Development Update. Abstract This presentation will focus on IBM's plans for the future of Domino as an application development platform. We will discuss IBM's plans for adding key functionality to Domino as well as ways to allow customers to modernize their applications for use via web and mobile devices. This presentation is key for anybody who uses Domino as an application development platform and is interested in moderni
13
IBM Notes Domino Feature Pack 8 Available for Download from IBM Fix Central
Tue, Mar 7th 2017 6:18p   Johnny Oldenburger
Today IBM has released IBM Domino and IBM Notes FP8 on IBM Fix Central. 9.0.1 Feature Pack 8 is a collection of new features and low-risk, high-impact fixes to help customers safely avoid known issues. IBM strongly recommends that customers running Notes/Domino 9.0.1x upgrade to this latest Fix Pack since it adds new features and addresses a small percentage of defects that impact the broadest set of customers. Fix Packs are released periodically to provide a greater level of stability for custo
8
IBM Open Mic Webcast - What's new in Notes & Domino 9.0.1 FP8?
Thu, Mar 2nd 2017 6:58p   Johnny Oldenburger
On April 15th there will be a webcast about What's new in Notes & Domino 9 FP8? Abstract A discussion of the new features in Feature Pack 8 with the developers responsible for the release and contacts in support. After a presentation, attendees will be given an opportunity to ask our panel of experts questions. Throughout the event, attendees will also be encouraged to comment or ask questions in the IBM Connections Meetings Web chat. Follow us on Twitter @IBM_ICSsupport. Content Topic: W
14
Modernizing IBM Domino Applications with Sapho
Fri, Feb 24th 2017 3:00p   Johnny Oldenburger
At present, there exist a number of "tools" for modernizing IBM Domino Applications. Through the blog post 'IBM Connect 2017 #3: I’ve Seen The Future of Domino and it is Sapho'. I found out that in addition to the existing tools also Sapho is available for the modernization of existing Domino applications. Sapho’s deep integration with IBM Domino allows IT to build micro apps that interact with Domino databases and business logic. Domino databases contain a treasure trove of enterprise
9
IBM Notes Tip: Prevent Pasting of Documents in Notes Views through LotusScript Agents
Tue, Feb 21st 2017 6:00a   Johnny Oldenburger
Last week I was asked to ensure through LotusScript Agents that users no longer have the possibility to paste documents in the Notes Views within a specific Notes Database. As always there are several ways to achieve this. In the following I created two LotusScript Agents which ensure that pasting of documents in all views within the specific Notes database no longer is possible. All pasted documents will be immediately removed by the Agents. A. Agent Delete Pasted Documents Option Public Sub I




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