Calc/Features/DataPilot drill-down on data field

From Apache OpenOffice Wiki
< Calc‎ | Features
Revision as of 04:03, 30 November 2007 by Kohei (Talk | contribs)

Jump to: navigation, search

DataPilot Drill-Down on Data Field

Abstract

Foo

References

Fill this.

Contacts

Fill this.

Description

When a cell within the data field is double-clicked, it inserts a new sheet containing a subset of rows from the original data source that constitutes the result data displayed in that cell. For instance, when the data field function is selected to be SUM, then the number that is shown in the data field cell must be identical to the sum of all the data field values in the constituent rows displayed in the inserted sheet.

The area that can provide a drill-down sheet spans from the top-left cell in the data field to the bottom-right corner of the data pilot output, including the Total Result row and column.

The same function is available using "Data / Group and Outline / Show Details" from the menu, with the cell cursor on the result cell.

Hidden items ("Hide items" or "Show automatically" in the field options dialog) are not evaluated, the rows for the hidden items are included.

The feature is available for DataPilot tables from cell ranges or database data, but not yet for external service implementations (see API Change below).

API Change (not for 2.4)

This functionality introduces the following new API.

DataPilotSource

DataPilotFieldFilter

[idl,N] module com { module sun { module star { module sheet {

struct DataPilotFieldFilter {

   /** Field name. */
   string FieldName;
   /** String value that needs to match against. */
   string MatchValue;

};

}; }; }; };

DataPilotTablePositionData

[idl,N] module com { module sun { module star { module sheet {

//=============================================================================

struct DataPilotTablePositionData {

   /** See DataPilotTablePositionType. */
   long    PositionType;
   /** Different depending on the position type. */
   any     PositionData;

};

//=============================================================================

}; }; }; };

DataPilotTablePositionType

[idl,N] module com { module sun { module star { module sheet {

//============================================================================

constants DataPilotTablePositionType {

   //------------------------------------------------------------------------
   const long NOT_IN_TABLE = 0;
   //------------------------------------------------------------------------
   const long RESULT = 1;
   //------------------------------------------------------------------------
   const long ROW_HEADER = 2;
   //------------------------------------------------------------------------
   const long COLUMN_HEADER = 3;
   //------------------------------------------------------------------------

};

//============================================================================

}; }; }; };

DataPilotTableRegion

[idl,N] constants DataPilotTableRegion {

   //------------------------------------------------------------------------
   const long WHOLE = 0;
   //------------------------------------------------------------------------
   const long TABLE = 1;
   //------------------------------------------------------------------------
   const long RESULT = 2;

};

DataPilotTableResultData

[idl,N] struct DataPilotTableResultData {

   sequence< DataPilotFieldFilter >    FieldFilters;
   long                                DataFieldIndex;
   DataResult                          Result;

};

XDataPilotTable2

[idl,N] module com { module sun { module star { module sheet {

interface XDataPilotTable2: com::sun::star::sheet::XDataPilotTable {

   sequence< sequence< any > > getDrillDownData( [in] com::sun::star::table::CellAddress aAddr );
   DataPilotTablePositionData getPositionData( [in] com::sun::star::table::CellAddress aAddr );
   void insertDrillDownSheet( [in] com::sun::star::table::CellAddress aAddr );
   com::sun::star::table::CellRangeAddress getOutputRangeByType( [in] long nRegionType );

};

}; }; }; }; The interface com.sun.star.sheet.XDataPilotTable2 extends the existing com.sun.star.sheet.XDataPilotTable interface to provide additional method getDrillDownData() so that the client code can obtain constituent rows from the data pilot table. The existing com.sun.star.sheet.DataPilotTable service will support this new interface.

XDrillDownDataSupplier

[idl,N] module com { module sun { module star { module sheet {

interface XDrillDownDataSupplier: com::sun::star::uno::XInterface {

   sequence< sequence< any > > getDrillDownData( 
       [in] sequence< com::sun::star::sheet::DataPilotFieldFilter > aFilters );

};

}; }; }; };

The com.sun.star.sheet.DataPilotSource service will support the XDrillDownDataSupplier interface to provide a 2-dimensional array data consisting of a subset of the original data source table that satisfies a given set of filtering criteria. A sequence of DataPilotFieldFilter provides desired filtering criteria to getDrillDownData() method. This interface is intended for an external UNO package so that it can overwrite the interface to provide constituent rows when requested.

Migration

This does not affect migration as it is a completely new feature. However, it may help migration from Excel as Excel already has similar feature in place.

Configuration

File Format

This feature will not introduce a file format change.

Open Issues

Personal tools