How to export categorized view into excel for reports

I have created one view contains 3 colums total,subcategory,year-month.subcategory and year-month are categorized.I am displaying total no of subcategories in one category in a particular month.i.e the total.I have created one form Daterange for start date and end date.Now how to export the data totals basing on dates of subcategories into excel?

can any one give to me a sample code?

thanks in advance

Subject: how to export categorized view into excel for reports

What investigation have you done so far/where have you looked?

You can’t just keep asking the same question over and over again and expect people to answer

You will probably have to move away from using a view in your actual code - instead, build a NotesDocumentCollection using your date parameters to loop through

Subject: RE: how to export categorized view into excel for reports

I have done like this

Set xlapp=createobject(“Excel.Application”)

xlapp.Application.Workbooks.Open filepath$

xlapp.workbooks.add



xlapp.worksheets(1).Name="Inquiry Info"

Set vw=db.GetView("CustomerByCategory")

xlapp.worksheets(1).Range("A28").value="Category"

xlapp.worksheets(1).Range("B28").value=Cstr(uidoc.FieldGetText("StartDate"))

Set nav=vw.CreateViewNav

Set entry=nav.GetFirst

'Set doc=vw.GetFirstDocument

irow=29

icol=1

startrow=irow

While Not(entry Is Nothing)

	If entry.IsCategory Then 'new partner

		xlapp.cells(irow, icol) = entry.ColumnValues(1)

	'Else 'detail row

	'	For i = 1 To 6

	'		xlapp.cells(irow, icol+i) = entry.ColumnValues(i+1)

	'	Next

	End If

	'irow = irow + 1

	Set entry = nav.GetNext(entry)

Wend

but here I unable to generating daterange.I am exporting startdate from form.but how to generate i am not getting idea.

pls give an sample code or links

thanks