To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=42199
User nn changed the following:
What |Old value |New value
================================================================================
Status|NEW |RESOLVED
--------------------------------------------------------------------------------
Resolution| |FIXED
--------------------------------------------------------------------------------
------- Additional comments from [email protected] Tue Feb 2 16:39:11 +0000
2010 -------
Fixed in CWS "datapilotapi". The following Basic macro creates a DataPilot table
based on the Bibliography database:
Sub InsertDatabaseTable
oTables = ThisComponent.Sheets(0).DataPilotTables
oDescriptor = oTables.createDataPilotDescriptor
dim aImpDesc(0 to 2) as new com.sun.star.beans.PropertyValue
aImpDesc(0).Name = "DatabaseName"
aImpDesc(0).Value = "Bibliography"
aImpDesc(1).Name = "SourceType"
aImpDesc(1).Value = com.sun.star.sheet.DataImportMode.TABLE
aImpDesc(2).Name = "SourceObject"
aImpDesc(2).Value = "biblio"
oDescriptor.ImportDescriptor = aImpDesc()
oFields = oDescriptor.DataPilotFields
oFields.getByName("Author").Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.ROW
oFields.getByName("Year").Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.COLUMN
oDataField = oFields.getByName("ISBN")
oDataField.Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.DATA
oDataField.Function = com.sun.star.sheet.GeneralFunction.COUNT
dim aOutPos as new com.sun.star.table.CellAddress
aOutPos.Column = 1
aOutPos.Row = 5
aOutPos.Sheet = 0
oTables.insertNewByName("MyTable1", aOutPos, oDescriptor)
End Sub
If the DataPilotSource example from the DevGuide is registered, this macro
creates a DataPilot table based on it:
Sub InsertServiceTable
oTables = ThisComponent.Sheets(0).DataPilotTables
oDescriptor = oTables.createDataPilotDescriptor
oDescriptor.SourceServiceName = "ExampleDataPilotSource"
oFields = oDescriptor.DataPilotFields
oFields.getByName("ones").Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.COLUMN
oFields.getByName("tens").Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.ROW
oFields.getByName("value").Orientation = _
com.sun.star.sheet.DataPilotFieldOrientation.DATA
dim aOutPos as new com.sun.star.table.CellAddress
aOutPos.Column = 1
aOutPos.Row = 5
aOutPos.Sheet = 0
oTables.insertNewByName("MyTable2", aOutPos, oDescriptor)
End Sub
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]