Hi I am exporting the fields to Excel,and finding it very intersting,but facing many problems.
My Requirements are
1)Export the data to Excel(Some what it’s a Report)
2)Create the charts from the data exported.
Currently I am on point no 1
What is Required here the data should be exported,and we should only give the starting cell,it should automatically export the data
in rows and columns.I am able to export the data by hard coding the cell address,but i need it should export data automatically in Rows and columns
For Reference i am pasting my code.
n=1
Do While Not doc Is Nothing
B=1
datetime.LSLocalTime=doc.logged(0)
efromD.LSLocalTime=thisdoc.efromD(0)
etoD.LSLocalTime=thisdoc.etoD(0)
If dateTime.DateOnly>=efromD.dateonly Then
If dateTime.DateOnly<=etoD.dateonly Then
n = n + 1(N is used for column Address)
'Printing the Column Heading in the Cells
excelApp.sheets(1).range("A" & Cstr(3)).value = "Breakup of IS Requests for the Month Of-----"
excelApp.Selection.ColumnWidth = 15
excelApp.Range("A3").Font.Bold = True
excelApp.Range("A3").Font.ColorIndex = 1
excelApp.sheets(1).range("B" & Cstr(n)).value = doc.r_category(0)(Here hard coding the cell names,but need the cell names should appear
Programtically,as the data is not fixed always ,it keep on increasing or decreasing)
Assigned=doc.r_assignedto(0)+doc.r_category(0)
Set doc1=view.getdocumentbykey(Assigned)
Set vc = view.GetAllEntriesByKey(Assigned)
B=vc.count
excelApp.sheets(1).range("B" & Cstr(n)).value = B
excelApp.sheets(1).range("C" & Cstr(n)).value = doc.r_assignedto(0)
End If
End If
Set doc = view.getnextdocument(doc)
Loop
Call excelApp.save
excelApp.ActiveWorkBook.close
Call excelApp.quit