Page 1 sur 1

Trie sur une collection

MessagePublié: 01 Juin 2010 à 14:03
par kagura31
Bonjour,

J'ai un agent qui recupère une collection par une vue.
J'aimerai pouvoir faire un tri sur cette collection.
Je m'explique :

Code : Tout sélectionner
Set colRapp = vwRapp.getAllDocumentsByKey( sDateDeb + sDomaine )


J'ai voulu faire :
Code : Tout sélectionner
Dim sStructure As String
sStructure = docDialog.getItemValue( "StructureRap" )(0)
Dim colRapp2 As NotesDocumentCollection

Set colRapp2 = Nothing

Set docCurrent = colRapp.getFirstDocument
While Not docCurrent Is Nothing
  If docCurrent.StructureLect(0) = sStructure Then
        Call colRapp2.AddDocument( docCurrent )
  End If
 Set docCurrent = colRapp.GetNextDocument(docCurrent)
Wend


J'ai une erreur, qui me dit "variable d'objet non définie" sur le "call colRapp2.AddDocument.."

MessagePublié: 01 Juin 2010 à 14:06
par Michael DELIQUE
salut

trié une collection comme tu le fais est impossible

tu as 2 solution passer par une fonction de tri qui te renvois un variant => http://forum.dominoarea.org/tri-dune-co ... 20606.html

passer par un notesviewentrycollection su tu t'appuie sur une vue

un post récent sur le sujet => http://forum.dominoarea.org/trie-dune-n ... 25376.html

MessagePublié: 02 Juin 2010 à 14:34
par kagura31
Bonjour,

J'ai trouvé la solution à mon problème.
Code : Tout sélectionner
Dim sStructure As String
sStructure = docDialog.getItemValue( "StructureRap" )(0)
Dim colRapp2 As NotesDocumentCollection

Set colRapp2= vwRapp.getAllDocumentsByKey( "Clef ke c sure kelle existe pas :p" )

Set docCurrent = colRapp.getFirstDocument
While Not docCurrent Is Nothing
  If docCurrent.StructureLect(0) = sStructure Then
        Call colRapp2.AddDocument( docCurrent )
  End If
 Set docCurrent = colRapp.GetNextDocument(docCurrent)
Wend

MessagePublié: 02 Juin 2010 à 14:37
par Michael DELIQUE
re,

tu avais aussi cette solution

Call notesDocumentCollection.FTSearch( query$, maxDocs% )

qui permet de faire un select sur une collection

MessagePublié: 02 Juin 2010 à 19:35
par roubech
au hasard ?
Set colRapp2=new NotesDocumentCollection

MessagePublié: 02 Juin 2010 à 20:11
par Michael DELIQUE
au derniere nouvelle il n'y avait pas de constructeur pour une NotesdocumentCollection

MessagePublié: 02 Juin 2010 à 20:53
par roubech
j'aurai tenté ^^

MessagePublié: 03 Juin 2010 à 11:16
par Aquanotes

MessagePublié: 03 Juin 2010 à 11:29
par Michael DELIQUE
et bien IBM a enfin entendu notre appel !

il ya un constructeur de collection à partir de la R8 cool