Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How does Integra work with views having multi-value columns using the Show Multiple Values as Separate Entriesoption?

When creating a Notes view with a sorted or categorised column referring to a multi-value field then the view shows one document entry for each value in the multi-value field of the particular document. Hence one document appears in the view as many times as the number of elements in the multi-value field. The same applies if a column has a formula that returns a multi-value.

Obstacles

Before looking into possible profile configurations it is important to understand how Notes and Integra for Notes are working with the above view/column configuration::

The feature of Notes to show multiple values as separate entries is a very powerful option in that it provides quite a number of possible presentations of the documents in a view; especially if combined with other view options not discussed in this FAQ. This fact makes it a near impossible task to cover all combination and to provide Integra for Notes with the capability to export documents 100% exactly as displayed in a Notes view.

Currently Integra for Notes does support the correct output with regards to sorting, categorising and number of document instances displayed with only one column referring to a multi-value field or formula. However, as it is not possible to determine if a column has this option enabled or not, Integra for Notes has to assume that it is enabled. Therefore Integra for Notes will always export a particular document for which any of the sorted or categorised columns returns a multi-value for each element in the multi-value in turn.

As said above, in the current version of Integra for Notes this works only in accordance with Lotus Notes views, if only one such sorted or categorised column exists within the view. If a column is not sorted or categorised Integra for Notes will simply normalise the multi-value according to the profile's multi-value separator. If a view contains more than one such columns, the results are different to what one would expect.

Another issue with the Show multiple values as separate entries option is that a profile creator may want to export each value of the multi-value field as displayed in the view for each document entry. Hence for each instance (subset) of the multi-value field the document is exported for.

Again, this is quite a tricky one. This as Lotus Notes does not provide any means to determine the subset of a multi-value field used for the current instance selected in a view. In matter of fact the NotesDocument.Values property always returns the entire multi-value for each of the document instances. And it is also only available for documents retrieved from a NotesView. Documents retrieved from a NotesDocumentCollection do not provide this property.

Scenarios & Solutions

When an Integra for Notes profile is to run on all documents contained in a preselected view, hence the user does not have to select documents within the active view, this recommended solution is not to use the Show multiple values as separate entries option and to programmatically export the listed document for each multi-value subset of a particular multi-value field contained in the exported documents. We already have provided an FAQ that explains how to do this. Though the example is showing the solution for a single multi-value field, it is perfectly possible to modify the code to support multiple multi-value fields. Open the following link to see the example code:

If the above is not an option, because existing views utilising the option are needed by users to export data with Integra for Notes on selected documents, then the following example code shows how to retrieve the current subset of a multi-value field. But before using the code we suggest that you look at the following links which give some insight to the Integra for Notes runtime libraries:

The example shown assumes that there is only one multi-value column and that it is the first column in the view. It also assumes that the first field in the Selected Field List of the Integra profile is the same field that is used for the first column in the view.

Const CB_INITIALISE = 3
Const CB_BFORREADNOTES = 6
Const CB_BFORREADCOM = 7
Const CB_BFORWRITECOM = 1
Const CB_BFORWRITENOTES = 8
Const CB_BFORCOMACTION = 5
Const CB_BFORNOTESACTION = 2
Const CB_TERMINATE = 4

select case stats.cbstatus
case CB_INITIALISE
case CB_BFORREADNOTES
case CB_BFORREADCOM
case CB_BFORWRITECOM
    Dim mv As Variant
    ' Stores the value(s) of the first field in the field list. In this case the column returned
    ' a multi-value FValue() contains an array with x number of elements.

    mv = export.record.FValue(0)
    If IsArray(mv) Then
      ' the following loop checks for each multi-value instance whether
      ' it is contained in the currently processed subset of StaticVars.KeyArr() property
      ' the runtime object for this object class is called stats.

      For i = 0 To Ubound(mv)
        %rem
          NotesSortString() is a function that converts a string value into a format used by Integra for Notes to export documents in the exact order is displayed in the view. The ColSrt property of the stats object indicates whether the column that contains the multi-value field is sorted ascending or descending. As the example assumes that the multi-value column is the first column in the view, the index used is 0 (zero). The parameters needs to be adjusted if the column has a different position within the view. The index used for the column might differ from the index used for the FValue property. This as the order of fields in the Selected Field List can differ from the view columns.
        %endrem

        If instr(stats.keyarr(stats.keycnt),NotesSortString("" & mv(i),stats.colsrt(0))) > 0 then
          export.record.FValue(0) = mv(i)
          Exit For
        End If
      Next
    End If
case CB_BFORWRITENOTES
case CB_BFORCOMACTION
case CB_BFORNOTESACTION
    if not stats.savdoc is nothing then
      ' before save as...
    else
      ' before send to
    end if
case CB_TERMINATE
end select

.




FAQ# 0053
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024