OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Help in DATAPILOT OfficeOrg.CALC

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
wafu
Newbie
Newbie


Joined: 29 Jul 2009
Posts: 2

PostPosted: Mon Aug 03, 2009 10:45 pm    Post subject: Help in DATAPILOT OfficeOrg.CALC Reply with quote

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)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group