Difference between revisions of "Documentation/DevGuide/Spreadsheets/Column and Row Access"
From Apache OpenOffice Wiki
< Documentation | DevGuide
(Initial author Sun Microsystems, Inc.) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
|NextPage=Documentation/DevGuide/Spreadsheets/Data Array | |NextPage=Documentation/DevGuide/Spreadsheets/Data Array | ||
}} | }} | ||
− | {{DISPLAYTITLE:Column and Row Access}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Column and Row Access}} | ||
<!--<idltopic>com.sun.star.table.XColumnRowRange</idltopic>--> | <!--<idltopic>com.sun.star.table.XColumnRowRange</idltopic>--> | ||
The cell range interface <idl>com.sun.star.table.XColumnRowRange</idl> accesses the column and row ranges in the current cell range. A column or row range contains all the cells in the selected column or row. This type of range has additional properties, such as, visibility, and width or height. For more information, see [[Documentation/DevGuide/Spreadsheets/Columns and Rows|Columns and Rows]]. | The cell range interface <idl>com.sun.star.table.XColumnRowRange</idl> accesses the column and row ranges in the current cell range. A column or row range contains all the cells in the selected column or row. This type of range has additional properties, such as, visibility, and width or height. For more information, see [[Documentation/DevGuide/Spreadsheets/Columns and Rows|Columns and Rows]]. | ||
Line 15: | Line 16: | ||
<!--[SOURCE:Spreadsheet/SpreadsheetSample.java]--> | <!--[SOURCE:Spreadsheet/SpreadsheetSample.java]--> | ||
− | + | <syntaxhighlight lang="java"> | |
// --- Column properties. --- | // --- Column properties. --- | ||
com.sun.star.table.XColumnRowRange xColRowRange = (com.sun.star.table.XColumnRowRange) | com.sun.star.table.XColumnRowRange xColRowRange = (com.sun.star.table.XColumnRowRange) | ||
Line 29: | Line 30: | ||
UnoRuntime.queryInterface(com.sun.star.container.XNamed.class, aColumnObj); | UnoRuntime.queryInterface(com.sun.star.container.XNamed.class, aColumnObj); | ||
System.out.println("The name of the wide column is " + xNamed.getName() + "."); | System.out.println("The name of the wide column is " + xNamed.getName() + "."); | ||
+ | </syntaxhighlight> | ||
+ | {{PDL1}} | ||
− | + | [[Category:Documentation/Developer's Guide/Spreadsheet Documents]] | |
− | [[Category: Spreadsheet Documents]] | + |
Latest revision as of 15:22, 3 January 2021
The cell range interface com.sun.star.table.XColumnRowRange accesses the column and row ranges in the current cell range. A column or row range contains all the cells in the selected column or row. This type of range has additional properties, such as, visibility, and width or height. For more information, see Columns and Rows.
- The method
getColumns()
returns the interface com.sun.star.table.XTableColumns of the collection of columns. - The method
getRows()
returns the interface com.sun.star.table.XTableRows of the collection of rows.
// --- Column properties. --- com.sun.star.table.XColumnRowRange xColRowRange = (com.sun.star.table.XColumnRowRange) UnoRuntime.queryInterface(com.sun.star.table.XColumnRowRange.class, xCellRange); com.sun.star.table.XTableColumns xColumns = xColRowRange.getColumns(); Object aColumnObj = xColumns.getByIndex(0); xPropSet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, aColumnObj); xPropSet.setPropertyValue( "Width", new Integer( 6000 ) ); com.sun.star.container.XNamed xNamed = (com.sun.star.container.XNamed) UnoRuntime.queryInterface(com.sun.star.container.XNamed.class, aColumnObj); System.out.println("The name of the wide column is " + xNamed.getName() + ".");
Content on this page is licensed under the Public Documentation License (PDL). |