Please help..excel report

Here is my problem.

I am creating monthly reports in excel.

I have two forms A, B

user 1 created 10 documents with company X using form A (If same user+company name+form then I want just one company name but I need 10 document totals)

user 1 created 3 documents with company Y using Form B (three seperate entites in excel)

User 2 created 4 documents with company abc using Form A

user2 created 2 documents with company ghi using form B

I want to show the result in excel in this format

name Company check check1 check 2 Total

User1 X 10 10 10 30

user1 Y 1 1 1 3

user1 y 1 0 0 1

user1 y 0 1 1 2

--	   --	--	--             --

user1 ToTal 12 12 12 36

user2 abc 4 4 4 12

user2 ghi 1 0 1 2

user2 ghi 1 1 1 3

  --	--	  --	--

user2 Total 6 5 6 17

Based on the search criteria I am getting the docuemnt collection but after that i don’t know how to export it to excel in above given format.

Please provide some code to solve this. I am stuck with this from two days.

here is ths code

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim doc1 As NotesDocument

Dim session As New NotesSession

Dim db As NotesDatabase

Dim filename As String

Dim j As Long

Dim xlApp As Variant

Dim xlsheet As Variant

Dim dc As NotesDocumentCollection

Dim CurrDoc As NotesDocument	

Dim dt As New NotesDateTime("")





Set uidoc = ws.CurrentDocument

Set doc1 = uidoc.document

Set db = session.CurrentDatabase



Rtitle		= uidoc.FieldGetText("RType")

Rev		= uidoc.fieldgettext("Rev")

Cname	= uidoc.fieldgettext("Cnam")



SearchString$ = {Form = "FollowUp"} & {& DCDate >=[} & doc1.FDate(0) & {]} & {& DCDate <=[} & doc1.TDate(0) &{]}



SearchString$ = SearchString$ & {|} & {(} & {BeginDate >= [} & doc1.FDate(0) & {]} & {& BeginDate <=[} & doc1.TDate(0) & {]} & {)}



Set dc = db.Search(SearchString$,dt, 0)

''From here i don’t know how to loop through the docs to get the above result???.

Thanks

Sri

Subject: Please help…excel report

Thanks John,

I can export the detail data to excel but don’t don’t know how to automate the pivot feature. Can you please provide some code.

Sri

Subject: RE: Please help…excel report

The code all depends on how you are loading your data. after it is loaded, record the macro in excel to summarize, then basically copy the code to your script. There are usually small changes tot he VB code. There are lots of examples of doing this in this and the r5 forum.

John

Subject: Please help…excel report…searched

Thanks for the quick reply.I searched the forum for automate and pivot table and couldn’t find any help??.

Subject: RE: Please help…excel report…searched

https://www-10.lotus.com/ldd/nd6forum.nsf/search?SearchView&Query=pivot%20AND%20table&SearchOrder=1&SearchMax=0&SearchWV=FALSE&SearchFuzzy=FALSE&Start=1&Count=100

was in the r6 forum, and gave about 10 hits, you can then read all the threads with it.

Subject: Please help…excel report

you can load your detail data into a spreadsheet, and then just automate the pivot table feature.

you can alos cerate a list with your users, and then add the values to the list array.

it should not take much more than 1 hour to solve your issue either way.