The fixed issue with Basic code to create a pilot: http://www.openoffice.org/issues/show_bug.cgi?id=42199
A quick and dirty macro printing info about a pilot's import descriptor:
Code: Select all
Sub PrintPilotImportInfo()
oInitialTarget =ThisComponent
Dim oSpreadsheet As Object
Dim oDataPilotTables As Object
Dim oObj_1 As Object
Dim oPropertyValue As Object
oSpreadsheet = oInitialTarget.Sheets.getByName("Pivot")
oDataPilotTables = oSpreadsheet.DataPilotTables
oObj_1 = oDataPilotTables.getByIndex(0)
oPropertyValue = oObj_1.getPropertyValue("ImportDescriptor")
'0 DatabaseName ="PVC"
'1 SourceType =com.sun.star.sheet.DataImportMode.TABLE
'2 SourceObject ="List"
'3 IsNative =False
Dim sImport$
select case oPropertyValue(1).Value
case is=com.sun.star.sheet.DataImportMode.NONE
sImport="Not Imported"
case is=com.sun.star.sheet.DataImportMode.SQL
If oPropertyValue(3).Value then
sImport= "Source:"& oPropertyValue(0).Value &", "& "Native SQL:"
else
sImport= "Source:"& oPropertyValue(0).Value &", "& "Parsed SQL:"
endif
case is=com.sun.star.sheet.DataImportMode.TABLE
sImport= "Source:"& oPropertyValue(0).Value &", "& "Table:"
case is=com.sun.star.sheet.DataImportMode.QUERY
If oPropertyValue(3).Value then
sImport= "Source:"& oPropertyValue(0).Value &", "& "Native Query:"
else
sImport= "Source:"& oPropertyValue(0).Value &", "& "Parsed Query:"
endif
end select
Print sImport & oPropertyValue(2).Value
End Sub