wafu Newbie

Joined: 29 Jul 2009 Posts: 2
|
Posted: Mon Aug 03, 2009 10:45 pm Post subject: Help in DATAPILOT OfficeOrg.CALC |
|
|
Hi, im working with datpilot in OfficeOrg.Calc
What I want with my datapilot is to show the field "date" as its rows and field "riders" as its column, and here's the problem, i want to show in the data field of the datapilot the count of a specific rider per date like this
____________ |___RIDERS_________________________________________
DATE________|__Rider Name 1___|__Rider Name 2____|____Total Result____
08/01/09_____|______1_________|_______2_________|_______3_________
08/02/09_____|______3_________ |______ 1_________ |_______4_________
Total Result___|______4________ |_______ 4_________ |_______7_________
the numbers in the data field was get by, if rider 1 has made 1 delivery for 08/01/09 then it is counted as 1 and so on..do you get it?
here's my code, my datapilot shows the rows and colums but the numbers in the data field of datapilot doesn't show..pls help me...
| Code: |
oTDesc = oSheetObj.createDataPilotDescriptor()
oRanges = ThisComponent.NamedRanges
oRange = oRanges.getByName("Excel_BuiltIn__FilterDatabase_4")
aSourceAddress = oRange.getReferredCells().getRangeAddress()
oTDesc.setSourceRange(aSourceAddress)
oTDesc.IgnoreEmptyRows = True
'initialize fields
Dim oFields
Dim oField
oFields = oTDesc.getDataPilotFields()
'date
oField = oFields.getByName("DATE")
oField.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.ROW
'data
oField = oFields.getByName("RIDER")
oField.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.DATA
oField.function = com.sun.star.sheet.GeneralFunction.COUNT
oField.setPropertyValue("ShowEmpty",0) =0
'rider
oField = oFields.getByName("RIDER")
oField.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.COLUMN
'functions
oField = oFields.getByName("RIDER")
oField.function = com.sun.star.sheet.GeneralFunction.COUNT
'output
Dim oDestAddr as New com.sun.star.table.CellAddress
Dim oDest
oSheet = ThisComponent.Sheets.getByName("Checker")
oDest = oSheet.getCellRangeByName("A8")
oDestAddr.Sheet = oSheet.getCellRangeByName("A1").getRangeAddress.Sheet
oDestAddr.Column = 0
oDestAddr.Row = 7
oSheetObj.insertNewByName("DataPilotExample", oDestAddr, oTDesc)
|
|
|