Difference between revisions of "Documentation/DevGuide/Spreadsheets/Data Array"

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/Absolute Address
 
|NextPage=Documentation/DevGuide/Spreadsheets/Absolute Address
 
}}
 
}}
{{DISPLAYTITLE:Data Array}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Data Array}}
 
<!--<idltopic>com.sun.star.sheet.XCellRangeData</idltopic>-->
 
<!--<idltopic>com.sun.star.sheet.XCellRangeData</idltopic>-->
 
The contents of a cell range that are stored in a 2-dimensional array of objects are set and obtained by the interface <idl>com.sun.star.sheet.XCellRangeData</idl>.
 
The contents of a cell range that are stored in a 2-dimensional array of objects are set and obtained by the interface <idl>com.sun.star.sheet.XCellRangeData</idl>.

Revision as of 10:24, 14 May 2009



The contents of a cell range that are stored in a 2-dimensional array of objects are set and obtained by the interface com.sun.star.sheet.XCellRangeData.

  • The method getDataArray() returns a 2-dimensional array with the contents of all cells of the range.
  • The method setDataArray() fills the data of the passed array into the cells. An empty cell is created by an empty string. The size of the array has to fit in the size of the cell range.

The following example uses the cell range xCellRange that has the size of 2 columns and 3 rows.

 // --- Cell range data ---
 com.sun.star.sheet.XCellRangeData xData = (com.sun.star.sheet.XCellRangeData)
     UnoRuntime.queryInterface(com.sun.star.sheet.XCellRangeData.class, xCellRange);
 
 Object[][] aValues =
 {
     {new Double(1.1), new Integer(10)},
     {new Double(2.2), new String("")},
     {new Double(3.3), new String("Text")}
 };
 
 xData.setDataArray(aValues);


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages