Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How to export data from multiple fields in selected Notes documents to separate rows in a CSV file

Let us take the following scenario. The personal address book stores contact details inside a person document. Each person document contains several contact numbers, such as office phone number, cell phone number, and home phone number. The contact number of the various people need to be exported to a CSV file, however, each contact number is to be exported to a separate row in the CSV file.

This FAQ explains how this is achieved using Integra for Notes.

Create a Text Integra profile linked to the personal address book database. Select the fields that you want to export from the Contact document. The screenshot below displays the list of fields and field types selected in our profile.



The formula stored in the Name field is @Trim(FirstName+" "+LastName), while the Phone field contains no formula.

The Integra profile can be set up to run on All documents in view or on Selected documents in active view. Set the file format field to CSV.

The Callback Script (advanced tab in the Integra profile) code sample below shows how to export a contact number per row in the following format: name - phonetype, phone, company, category. The code must be placed in the CB_BFORWRITECOM event.


case CB_BFORWRITECOM

    Dim pers_name As String

    'Store the name of the contact being exported. This must be stored since in this example, the name and phone type data will be exported as one field.
    pers_name = export.record.fvalue(0)

    'Integra will not export any data. The data will be exported through the code below.
    export.continue = false

    'The office phone number is exported if not blank
    if not Trim(stats.expdoc.OfficePhoneNumber(0)) = "" then

    'Store the name and phone type in the Name field
    export.record.fvalue(0) = pers_name & " - " & stats.expdoc.PhoneLabel_1(0)


    'Store the contact number in the phone field
    export.record.fvalue(1) = stats.expdoc.OfficePhoneNumber(0)


    'The row is written to the CSV file
    call export.WriteNext(stats)
    end if

    'The cell phone number is exported if not blank
    if not Trim(stats.expdoc.CellPhoneNumber(0)) = "" then
    export.record.fvalue(0) = pers_name & " - " & stats.expdoc.PhoneLabel_5(0)
    export.record.fvalue(1) = stats.expdoc.CellPhoneNumber(0)
    call export.WriteNext(stats)
    end if


    'The above if statements can be repeated for the other contact numbers which need to be exported.

.




FAQ# 0194
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024