Seite 1 von 1

Calc - Datenpilot: Unterschiede OO / LO?

Verfasst: Di, 28.08.2012 13:27
von retuwe61
Hallo miteinander.

In der angehängten Testdatei soll mit dem Datenpiloten die Anzahl abgebildet werden. Unter OpenOffice 3.4.0 klappt das auch.
Wird das Makro unter LibreOffice in einer Version über 3.4 ausgeführt, wird leider die Summe abgebildet. Hat jemand eine Lösung dafür?
Danke für die Hilfe.
Gruß
Uwe

Code: Alles auswählen

Sub DatPilot
oDoc = ThisComponent
oSheet = oDoc.sheets.getByName("Daten")
     myView = oDoc.CurrentController
'     myView.setActiveSheet(oSheet)
oCellCursor = oSheet.createCursor() 
oCellCursor.GotoEndOfUsedArea(True)
letzte_Zeile = oCellCursor.getRangeAddress.EndRow 'letzte Zeile suchen
oRange=oSheet.getCellRangeByPosition(0,1,40,letzte_Zeile)

ZielZelle = oDoc.sheets.getByName("DatPilot").getCellRangeByName("D9")

Ziel = ZielZelle.getCellAddress

PilotTab = oSheet.getDataPilotTables()
PilotDesc = PilotTab.createDataPilotDescriptor()
Add = oRange.getRangeAddress()
PilotDesc.setPropertyValue("IgnoreEmptyRows",1)  =1
PilotDesc.setPropertyValue("ShowFilterButton",0) = 0 
PilotDesc.setSourceRange(Add)

PilotDesc.ShowFilterButton = FALSE
PilotDesc.RowGrand = FALSE 
PilotDesc.ColumnGrand = FALSE 

PilotFelder = PilotDesc.getDataPilotFields()

PilotFeld = PilotFelder.getByIndex(2)
PilotFeld.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.COLUMN

PilotFeld = PilotFelder.getByIndex(40)
PilotFeld.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.ROW
PilotFeld = PilotFelder.getByIndex(40)
PilotFeld.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.DATA
PilotFeld.Function = com.sun.star.sheet.GeneralFunction.COUNT

PilotTab.insertNewByName("DP1",Ziel,PilotDesc)

End Sub

Re: Calc - Datenpilot: Unterschiede OO / LO?

Verfasst: Mi, 29.08.2012 11:40
von Karolus
Hallo
Deine Testdatei funktioniert hier mit LO3.5 problemlos!

___
entweder:

Code: Alles auswählen

PilotDesc.setPropertyValue("IgnoreEmptyRows",1)
oder:

Code: Alles auswählen

PilotDesc.IgnoreEmptyRows = 1
___

Karolus

Re: Calc - Datenpilot: Unterschiede OO / LO?

Verfasst: Do, 30.08.2012 10:00
von retuwe61
Hallo Karolus.
Dank deines Hinweises habe ich die Version 3.5.6 neu installiert und damit funktionierte es.
Anschließend de- und Version 3.6.0.4 installiert und das Problem tritt wieder auf.
Gruß
Uwe

PS: Danke Peter!

Re: Calc - Datenpilot: Unterschiede OO / LO?

Verfasst: Do, 30.08.2012 10:44
von pmoegenb
retuwe61 hat geschrieben:Anschließend de- und Version 3.6.4 installiert und das Problem tritt wieder auf.
Wo hast Du denn diese Version her ? Aktuell bei LibO sind wir bei 3.6.1.2.