Calc - Datenpilot: Unterschiede OO / LO?

Programmierung unter AOO/LO (StarBasic, Python, Java, ...)

Moderator: Moderatoren

retuwe61
****
Beiträge: 159
Registriert: So, 18.11.2007 21:25

Calc - Datenpilot: Unterschiede OO / LO?

Beitrag 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
Dateianhänge
Testdatei.ods
(14.45 KiB) 54-mal heruntergeladen
Angewandt wird LibeOffice Version 5.1.6.2
Karolus
********
Beiträge: 7535
Registriert: Mo, 02.01.2006 19:48

Re: Calc - Datenpilot: Unterschiede OO / LO?

Beitrag 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
LO7.4.7.2 debian 12(bookworm) auf Raspberry5 8GB (ARM64)
LO25.2.3.2 flatpak debian 12(bookworm) auf Raspberry5 8GB (ARM64)
retuwe61
****
Beiträge: 159
Registriert: So, 18.11.2007 21:25

Re: Calc - Datenpilot: Unterschiede OO / LO?

Beitrag 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!
Zuletzt geändert von retuwe61 am Do, 30.08.2012 10:47, insgesamt 1-mal geändert.
Angewandt wird LibeOffice Version 5.1.6.2
pmoegenb
********
Beiträge: 4330
Registriert: Di, 22.06.2004 12:02
Wohnort: 71134 Aidlingen
Kontaktdaten:

Re: Calc - Datenpilot: Unterschiede OO / LO?

Beitrag 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.
Gruß

Peter
---------------------------------------------------------------------------
Windows 7 Prof. 64-bit SP1, LibreOffice 4.3.6.2 und AOO 4.1.1
Antworten