Difference between revisions of "Documentation/DevGuide/Spreadsheets/Handling Array Formulas"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/Spreadsheet Documents)
m (FINAL VERSION FOR L10N)
Line 7: Line 7:
 
|NextPage=Documentation/DevGuide/Spreadsheets/Cells
 
|NextPage=Documentation/DevGuide/Spreadsheets/Cells
 
}}
 
}}
{{DISPLAYTITLE:Handling Array Formulas}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Handling Array Formulas}}
 
<!--<idltopic>com.sun.star.sheet.XArrayFormulaRange</idltopic>-->
 
<!--<idltopic>com.sun.star.sheet.XArrayFormulaRange</idltopic>-->
 
The interface <idl>com.sun.star.sheet.XArrayFormulaRange</idl> handles array formulas.
 
The interface <idl>com.sun.star.sheet.XArrayFormulaRange</idl> handles array formulas.

Revision as of 10:24, 14 May 2009



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 getArrayFormula() method returns the translated function names, but not the English names. The setArrayFormula() method accepts English names without preceding equal sign and without curly braces. This is inconsistent to the methods setFormula() and getFormula() of the interface com.sun.star.table.XCell. The latter can be used in order to read the English array formula from one of the used cells.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages