Handling Array Formulas

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 12:33, 1 November 2007 by Jsc (talk | contribs) (Initial author Sun Microsystems, Inc.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



The interface com.sun.star.sheet.XArrayFormulaRange handles array formulas.

  • If the whole cell range contains an array formula, the method getArrayFormula() returns the formula string, otherwise an empty string is returned.
  • The method setArrayFormula() sets an array formula to the complete cell range.
 // --- Array formulas ---
 com.sun.star.sheet.XArrayFormulaRange xArrayFormula = (com.sun.star.sheet.XArrayFormulaRange)
     UnoRuntime.queryInterface(com.sun.star.sheet.XArrayFormulaRange.class, xCellRange);
 // Insert a 3x3 unit matrix.
 xArrayFormula.setArrayFormula("=A10:C12");
 System.out.println("Array formula is: " + xArrayFormula.getArrayFormula()); 
Documentation caution.png Due to a bug, this interface does not work correctly in the current implementation. The method accepts the translated function names, but not the English names. This is inconsistent to the method setFormula() of the interface com.sun.star.table.XCell.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools