Apache OpenOffice (AOO) Bugzilla – Issue 76297
com.sun.star.sheet.DataPilotDescriptor - IgnoreEmptyRows
Last modified: 2017-05-20 11:13:31 UTC
Hi, the property "IgnoreEmptyRows" from com.sun.star.sheet.DataPilotDescriptor handles rows containing formulars always as not empty ... Please have a look at the attachment ... Maybe one can add some options like we have for oRange.queryContentCells / oRange.queryFormulaCells ... Please have a look at http://qa.openoffice.org/issues/show_bug.cgi?id=57431 too Oliver
Created attachment 44368 [details] com.sun.star.sheet.DataPilotDescriptor - IgnoreEmptyRows
I checked with "2.2.1 Multilingual German version WIN XP: [680m18(Build9161)]" and can confirm the problem. Lines 8 and 14 of "IgnoreEmptyRowsDemo.ods" contain formulas, so that the Data Pilot creates unexpected "(Empty) sum results". When you delete the formulas, the "(Empty) sum results" disappear after refresh.
Hi Niklas, as Enhancement for you. Frank
verified in oo 3.1
playing with the datapilot i found 2 workarounds for the issue: REM ***** Apply a Filter ***** OPTION EXPLICIT Sub HideEmptyRows() Dim oDoc as Object Dim oSheet as Object Dim oDataPilot as Object Dim aFilterFields(0) as new com.sun.star.sheet.TableFilterField Dim aNoArgs(0) as new com.sun.star.sheet.TableFilterField oDoc = ThisComponent oSheet = oDoc.getSheets().getByIndex(0) oDataPilot = osheet.getDataPilotTables().getByIndex(0) aFilterFields(0).Field = 1 aFilterFields(0).IsNumeric = False aFilterFields(0).Operator = com.sun.star.sheet.FilterOperator.NOT_EQUAL aFilterFields(0).StringValue = "" oDataPilot.getFilterDescriptor().setFilterFields(aFilterFields()) oDataPilot.refresh() End Sub REM ***** Exclude from Sort ***** OPTION EXPLICIT Sub HideEmptyRows() Dim oDoc as Object Dim oSheet as Object Dim oDataPilot as Object Dim oRowField as Object Dim oItem as Object Dim i as Integer Dim j as Integer oDoc = ThisComponent oSheet = oDoc.getSheets().getByIndex(0) oDataPilot = osheet.getDataPilotTables().getByIndex(0) For i = 0 To oDataPilot.getRowFields().getCount()-1 oRowField = oDataPilot.getRowFields().getByIndex(i) 'Msgbox "RowField: " & oRowField.Name 'caution: oo will crash if one tries to hide items from "Data" ! If oRowField.Name <> "Data" Then oItem = oRowField.Items() For j = 0 To oItem.getCount()-1 'MsgBox i & " " & j & " " & oItem.getByIndex(j).Name If oItem.getByIndex(j).Name = "" Then oItem.getByIndex(j).isHidden = True EndIf Next j EndIf Next i End Sub
Reset assigne to the default "issues@openoffice.apache.org".