Need Help Lotusscript

Hello,

I have some category in view, please do follow down.

1)Category1

             2) Sub-Category1

                                    3)Sub-Category 1-1

                                                              doc1     6

                                                              doc2     7 

1)Category2

             2) Sub-Category2

                                    3)Sub-Category 2-2

                                                              doc1     6

                                                              doc2     8 

As per defined above i want take the handle the category1 and subcategory1 and will take handle down the line to the sub category 1-1. and want the sum of underline documents like 6 and 7 , then it would insert into excel.

and repeat the process until and unless the documents get end.

pls let me through code in LS.?

Dev

Subject: Need Help Lotusscript

Ignore the category as such

what u r essentially doing

is looping thru 2 conditions and totalling some field

There are enough excel sample codes in this forum.

So u should be able to come up with a solution.

Subject: RE: Need Help Lotusscript

Yazdi, could you please help me, you are right what i want.

though i dint found anything in this forum please help me through code.

Dev

Subject: RE: Need Help Lotusscript

you obviously didn’t look hard enough…

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/da395751267ed34a85257383006a416c?OpenDocument

that should take care of the excel portion…

brandt

Subject: RE: Need Help Lotusscript

You could build a NotesDocumentCollection for each Category/Subcategory by using the GetAllDocumentsByKey method and passing an array of Category and SubCategory

Once you have the NotesDocumentCollection, you can loop through each NotesDocument, get the field value and build up a total.

Once you have the total, export to Excel

Subject: RE: Need Help Lotusscript

Mike thanks for your help

could you please let me through little bit code…

hoping good hope.

Dev

Subject: RE: Need Help Lotusscript

Dim and set your view and all relevant variables

Dim coll as NotesDocumentCollection

dim arrayCat(1) as string

arrayCat(0)=whatever your category is

arrayCat(1)=whatever your subcategory is

set coll=view.GetAllDocumentsByKey(arrayCat(), True)

total = 0

set doc=coll.getfirstdocument

do until doc is nothing

total = total + doc.whatever the field is (eg doc.Price(0) )

set doc=coll.getnextdocument(doc)

Loop

once the loop has finished, total is the total of all the values on the documents within the collection

HTH

Mike

Subject: Need Help Lotusscript

it seems very long…:frowning:

anyway thanks…

dev