2008-01-16 11:08:22 -05:00
|
|
|
/* ====================================================================
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
==================================================================== */
|
|
|
|
|
|
|
|
package org.apache.poi.ss.usermodel;
|
|
|
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
import org.apache.poi.hssf.util.PaneInformation;
|
2008-09-17 17:54:32 -04:00
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-11-14 15:29:42 -05:00
|
|
|
/**
|
|
|
|
* High level representation of a Excel worksheet.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Sheets are the central structures within a workbook, and are where a user does most of his spreadsheet work.
|
|
|
|
* The most common type of sheet is the worksheet, which is represented as a grid of cells. Worksheet cells can
|
|
|
|
* contain text, numbers, dates, and formulas. Cells can also be formatted.
|
|
|
|
* </p>
|
|
|
|
*/
|
2008-03-29 19:04:48 -04:00
|
|
|
public interface Sheet extends Iterable<Row> {
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/* Constants for margins */
|
2008-10-21 13:56:34 -04:00
|
|
|
public static final short LeftMargin = 0;
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-10-21 13:56:34 -04:00
|
|
|
public static final short RightMargin = 1;
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-10-21 13:56:34 -04:00
|
|
|
public static final short TopMargin = 2;
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-10-21 13:56:34 -04:00
|
|
|
public static final short BottomMargin = 3;
|
|
|
|
|
|
|
|
public static final short HeaderMargin = 4;
|
|
|
|
|
|
|
|
public static final short FooterMargin = 5;
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
public static final byte PANE_LOWER_RIGHT = (byte) 0;
|
|
|
|
|
|
|
|
public static final byte PANE_UPPER_RIGHT = (byte) 1;
|
|
|
|
|
|
|
|
public static final byte PANE_LOWER_LEFT = (byte) 2;
|
|
|
|
|
|
|
|
public static final byte PANE_UPPER_LEFT = (byte) 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new row within the sheet and return the high level representation
|
|
|
|
*
|
|
|
|
* @param rownum row number
|
2008-11-14 15:29:42 -05:00
|
|
|
* @return high level Row object representing a row in the sheet
|
2008-10-21 13:56:34 -04:00
|
|
|
* @see #removeRow(Row)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
Row createRow(int rownum);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a row from this sheet. All cells contained in the row are removed as well
|
|
|
|
*
|
|
|
|
* @param row representing a row to remove.
|
|
|
|
*/
|
|
|
|
void removeRow(Row row);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the logical row (not physical) 0-based. If you ask for a row that is not
|
|
|
|
* defined you get a null. This is to say row 4 represents the fifth row on a sheet.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
|
|
|
* @param rownum row to get (0-based)
|
2008-10-28 06:03:51 -04:00
|
|
|
* @return Row representing the rownumber or null if its not defined on the sheet
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
Row getRow(int rownum);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns the number of physically defined rows (NOT the number of rows in the sheet)
|
|
|
|
*
|
|
|
|
* @return the number of physically defined rows in this sheet
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
int getPhysicalNumberOfRows();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Gets the first row on the sheet
|
|
|
|
*
|
|
|
|
* @return the number of the first logical row on the sheet (0-based)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
int getFirstRowNum();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Gets the last row on the sheet
|
|
|
|
*
|
|
|
|
* @return last row contained n this sheet (0-based)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
int getLastRowNum();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get the visibility state for a given column
|
|
|
|
*
|
2008-09-17 17:54:32 -04:00
|
|
|
* @param columnIndex - the column to get (0-based)
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param hidden - the visiblity state of the column
|
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
void setColumnHidden(int columnIndex, boolean hidden);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get the hidden state for a given column
|
|
|
|
*
|
2008-09-17 17:54:32 -04:00
|
|
|
* @param columnIndex - the column to set (0-based)
|
|
|
|
* @return hidden - <code>false</code> if the column is visible
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
boolean isColumnHidden(int columnIndex);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2011-07-28 18:53:46 -04:00
|
|
|
/**
|
|
|
|
* Sets whether the worksheet is displayed from right to left instead of from left to right.
|
|
|
|
*
|
|
|
|
* @param value true for right to left, false otherwise.
|
|
|
|
*/
|
|
|
|
public void setRightToLeft(boolean value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the text is displayed in right-to-left mode in the window
|
|
|
|
*
|
|
|
|
* @return whether the text is displayed in right-to-left mode in the window
|
|
|
|
*/
|
|
|
|
public boolean isRightToLeft();
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Set the width (in units of 1/256th of a character width)
|
2011-06-20 11:16:46 -04:00
|
|
|
*
|
2009-02-06 13:59:24 -05:00
|
|
|
* <p>
|
|
|
|
* The maximum column width for an individual cell is 255 characters.
|
|
|
|
* This value represents the number of characters that can be displayed
|
2011-06-20 11:16:46 -04:00
|
|
|
* in a cell that is formatted with the standard font (first font in the workbook).
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Character width is defined as the maximum digit width
|
2011-06-25 06:56:46 -04:00
|
|
|
* of the numbers <code>0, 1, 2, ... 9</code> as rendered
|
2011-06-20 11:16:46 -04:00
|
|
|
* using the default font (first font in the workbook).
|
|
|
|
* <br/>
|
|
|
|
* Unless you are using a very special font, the default character is '0' (zero),
|
|
|
|
* this is true for Arial (default font font in HSSF) and Calibri (default font in XSSF)
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Please note, that the width set by this method includes 4 pixels of margin padding (two on each side),
|
|
|
|
* plus 1 pixel padding for the gridlines (Section 3.3.1.12 of the OOXML spec).
|
|
|
|
* This results is a slightly less value of visible characters than passed to this method (approx. 1/2 of a character).
|
2009-02-06 13:59:24 -05:00
|
|
|
* </p>
|
2011-06-20 11:16:46 -04:00
|
|
|
* <p>
|
|
|
|
* To compute the actual number of visible characters,
|
|
|
|
* Excel uses the following formula (Section 3.3.1.12 of the OOXML spec):
|
|
|
|
* </p>
|
|
|
|
* <code>
|
|
|
|
* width = Truncate([{Number of Visible Characters} *
|
|
|
|
* {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
|
|
|
|
* </code>
|
|
|
|
* <p>Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi).
|
|
|
|
* If you set a column width to be eight characters wide, e.g. <code>setColumnWidth(columnIndex, 8*256)</code>,
|
|
|
|
* then the actual value of visible characters (the value shown in Excel) is derived from the following equation:
|
|
|
|
* <code>
|
|
|
|
Truncate([numChars*7+5]/7*256)/256 = 8;
|
|
|
|
* </code>
|
|
|
|
*
|
|
|
|
* which gives <code>7.29</code>.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-09-17 17:54:32 -04:00
|
|
|
* @param columnIndex - the column to set (0-based)
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param width - the width in units of 1/256th of a character width
|
2011-06-20 11:16:46 -04:00
|
|
|
* @throws IllegalArgumentException if width > 255*256 (the maximum column width in Excel is 255 characters)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
void setColumnWidth(int columnIndex, int width);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get the width (in units of 1/256th of a character width )
|
2011-06-20 11:16:46 -04:00
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Character width is defined as the maximum digit width
|
2011-06-25 06:56:46 -04:00
|
|
|
* of the numbers <code>0, 1, 2, ... 9</code> as rendered
|
2011-06-20 11:16:46 -04:00
|
|
|
* using the default font (first font in the workbook)
|
|
|
|
* </p>
|
|
|
|
*
|
2008-09-17 17:54:32 -04:00
|
|
|
* @param columnIndex - the column to set (0-based)
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return width - the width in units of 1/256th of a character width
|
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
int getColumnWidth(int columnIndex);
|
2008-11-14 15:29:42 -05:00
|
|
|
|
2008-09-17 17:54:32 -04:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Set the default column width for the sheet (if the columns do not define their own width)
|
|
|
|
* in characters
|
|
|
|
*
|
|
|
|
* @param width default column width measured in characters
|
2008-09-17 17:54:32 -04:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setDefaultColumnWidth(int width);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get the default column width for the sheet (if the columns do not define their own width)
|
|
|
|
* in characters
|
|
|
|
*
|
|
|
|
* @return default column width measured in characters
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
int getDefaultColumnWidth();
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get the default row height for the sheet (if the rows do not define their own height) in
|
2008-01-16 11:08:22 -05:00
|
|
|
* twips (1/20 of a point)
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
|
|
|
* @return default row height measured in twips (1/20 of a point)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
short getDefaultRowHeight();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get the default row height for the sheet (if the rows do not define their own height) in
|
2008-01-16 11:08:22 -05:00
|
|
|
* points.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return default row height in points
|
|
|
|
*/
|
|
|
|
float getDefaultRowHeightInPoints();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Set the default row height for the sheet (if the rows do not define their own height) in
|
2008-01-16 11:08:22 -05:00
|
|
|
* twips (1/20 of a point)
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
|
|
|
* @param height default row height measured in twips (1/20 of a point)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
void setDefaultRowHeight(short height);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Set the default row height for the sheet (if the rows do not define their own height) in
|
2008-01-16 11:08:22 -05:00
|
|
|
* points
|
|
|
|
* @param height default row height
|
|
|
|
*/
|
|
|
|
void setDefaultRowHeightInPoints(float height);
|
2009-06-03 23:38:52 -04:00
|
|
|
|
2009-01-06 15:49:02 -05:00
|
|
|
/**
|
|
|
|
* Returns the CellStyle that applies to the given
|
|
|
|
* (0 based) column, or null if no style has been
|
|
|
|
* set for that column
|
|
|
|
*/
|
|
|
|
public CellStyle getColumnStyle(int column);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the CellStyle that applies to the given
|
|
|
|
* (0 based) column.
|
|
|
|
*/
|
|
|
|
// public CellStyle setColumnStyle(int column, CellStyle style);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Adds a merged region of cells (hence those cells form one)
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param region (rowfrom/colfrom-rowto/colto) to merge
|
|
|
|
* @return index of this region
|
|
|
|
*/
|
2008-09-17 17:54:32 -04:00
|
|
|
int addMergedRegion(CellRangeAddress region);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Determines whether the output is vertically centered on the page.
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param value true to vertically center, false otherwise.
|
|
|
|
*/
|
|
|
|
void setVerticallyCenter(boolean value);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Determines whether the output is horizontally centered on the page.
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param value true to horizontally center, false otherwise.
|
|
|
|
*/
|
|
|
|
void setHorizontallyCenter(boolean value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether printed output for this sheet will be horizontally centered.
|
|
|
|
*/
|
|
|
|
|
|
|
|
boolean getHorizontallyCenter();
|
|
|
|
|
2009-03-27 07:50:52 -04:00
|
|
|
/**
|
|
|
|
* Determine whether printed output for this sheet will be vertically centered.
|
|
|
|
*/
|
|
|
|
boolean getVerticallyCenter();
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Removes a merged region of cells (hence letting them free)
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param index of the region to unmerge
|
|
|
|
*/
|
|
|
|
void removeMergedRegion(int index);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns the number of merged regions
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return number of merged regions
|
|
|
|
*/
|
|
|
|
int getNumMergedRegions();
|
|
|
|
|
2009-02-24 03:38:16 -05:00
|
|
|
/**
|
|
|
|
* Returns the merged region at the specified index
|
|
|
|
*
|
|
|
|
* @return the merged region at the specified index
|
|
|
|
*/
|
|
|
|
public CellRangeAddress getMergedRegion(int index);
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns an iterator of the physical rows
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return an iterator of the PHYSICAL rows. Meaning the 3rd element may not
|
|
|
|
* be the third row if say for instance the second row is undefined.
|
|
|
|
*/
|
2008-03-29 19:04:48 -04:00
|
|
|
Iterator<Row> rowIterator();
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2011-04-21 07:52:52 -04:00
|
|
|
/**
|
2011-06-27 11:40:48 -04:00
|
|
|
* Control if Excel should be asked to recalculate all formulas on this sheet
|
|
|
|
* when the workbook is opened.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Calculating the formula values with {@link FormulaEvaluator} is the
|
2011-04-21 07:52:52 -04:00
|
|
|
* recommended solution, but this may be used for certain cases where
|
|
|
|
* evaluation in POI is not possible.
|
2011-06-27 11:40:48 -04:00
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* To force recalcuation of formulas in the entire workbook
|
|
|
|
* use {@link Workbook#setForceFormulaRecalculation(boolean)} instead.
|
|
|
|
*
|
|
|
|
* @param value true if the application will perform a full recalculation of
|
|
|
|
* this worksheet values when the workbook is opened
|
|
|
|
*
|
|
|
|
* @see Workbook#setForceFormulaRecalculation(boolean)
|
2011-04-21 07:52:52 -04:00
|
|
|
*/
|
|
|
|
void setForceFormulaRecalculation(boolean value);
|
|
|
|
|
|
|
|
/**
|
2011-06-30 11:54:04 -04:00
|
|
|
* Whether Excel will be asked to recalculate all formulas in this sheet when the
|
2011-04-21 07:52:52 -04:00
|
|
|
* workbook is opened.
|
|
|
|
*/
|
|
|
|
boolean getForceFormulaRecalculation();
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether the sheet displays Automatic Page Breaks.
|
|
|
|
*
|
|
|
|
* @param value <code>true</code> if the sheet displays Automatic Page Breaks.
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-21 04:22:07 -05:00
|
|
|
void setAutobreaks(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Set whether to display the guts or not
|
2008-01-16 11:08:22 -05:00
|
|
|
*
|
2008-11-14 15:29:42 -05:00
|
|
|
* @param value - guts or no guts
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setDisplayGuts(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2009-02-24 03:38:16 -05:00
|
|
|
/**
|
|
|
|
* Set whether the window should show 0 (zero) in cells containing zero value.
|
|
|
|
* When false, cells with zero value appear blank instead of showing the number zero.
|
2009-06-03 23:38:52 -04:00
|
|
|
*
|
2009-02-24 03:38:16 -05:00
|
|
|
* @param value whether to display or hide all zero values on the worksheet
|
|
|
|
*/
|
|
|
|
void setDisplayZeros(boolean value);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.
|
|
|
|
* When false, cells with zero value appear blank instead of showing the number zero.
|
|
|
|
*
|
|
|
|
* @return whether all zero values on the worksheet are displayed
|
|
|
|
*/
|
|
|
|
boolean isDisplayZeros();
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether the Fit to Page print option is enabled.
|
|
|
|
*
|
|
|
|
* @param value <code>true</code> if the Fit to Page print option is enabled.
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setFitToPage(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether summary rows appear below detail in an outline, when applying an outline.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* When true a summary row is inserted below the detailed data being summarized and a
|
|
|
|
* new outline level is established on that row.
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* When false a summary row is inserted above the detailed data being summarized and a new outline level
|
|
|
|
* is established on that row.
|
|
|
|
* </p>
|
|
|
|
* @param value <code>true</code> if row summaries appear below detail in the outline
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setRowSumsBelow(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* When true a summary column is inserted to the right of the detailed data being summarized
|
|
|
|
* and a new outline level is established on that column.
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* When false a summary column is inserted to the left of the detailed data being
|
|
|
|
* summarized and a new outline level is established on that column.
|
|
|
|
* </p>
|
|
|
|
* @param value <code>true</code> if col summaries appear right of the detail in the outline
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setRowSumsRight(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether the sheet displays Automatic Page Breaks.
|
|
|
|
*
|
|
|
|
* @return <code>true</code> if the sheet displays Automatic Page Breaks.
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean getAutobreaks();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Get whether to display the guts or not,
|
|
|
|
* default value is true
|
2008-01-16 11:08:22 -05:00
|
|
|
*
|
2008-11-14 15:29:42 -05:00
|
|
|
* @return boolean - guts or no guts
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean getDisplayGuts();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether the Fit to Page print option is enabled.
|
|
|
|
*
|
|
|
|
* @return <code>true</code> if the Fit to Page print option is enabled.
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean getFitToPage();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether summary rows appear below detail in an outline, when applying an outline.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* When true a summary row is inserted below the detailed data being summarized and a
|
|
|
|
* new outline level is established on that row.
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* When false a summary row is inserted above the detailed data being summarized and a new outline level
|
|
|
|
* is established on that row.
|
|
|
|
* </p>
|
|
|
|
* @return <code>true</code> if row summaries appear below detail in the outline
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean getRowSumsBelow();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline.
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* When true a summary column is inserted to the right of the detailed data being summarized
|
|
|
|
* and a new outline level is established on that column.
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* When false a summary column is inserted to the left of the detailed data being
|
|
|
|
* summarized and a new outline level is established on that column.
|
|
|
|
* </p>
|
|
|
|
* @return <code>true</code> if col summaries appear right of the detail in the outline
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean getRowSumsRight();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Gets the flag indicating whether this sheet displays the lines
|
|
|
|
* between rows and columns to make editing and reading easier.
|
|
|
|
*
|
|
|
|
* @return <code>true</code> if this sheet displays gridlines.
|
|
|
|
* @see #isPrintGridlines() to check if printing of gridlines is turned on or off
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
boolean isPrintGridlines();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Sets the flag indicating whether this sheet should display the lines
|
|
|
|
* between rows and columns to make editing and reading easier.
|
|
|
|
* To turn printing of gridlines use {@link #setPrintGridlines(boolean)}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param show <code>true</code> if this sheet should display gridlines.
|
|
|
|
* @see #setPrintGridlines(boolean)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setPrintGridlines(boolean show);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the print setup object.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return The user model for the print setup object.
|
|
|
|
*/
|
|
|
|
PrintSetup getPrintSetup();
|
|
|
|
|
|
|
|
/**
|
2009-06-03 20:06:31 -04:00
|
|
|
* Gets the user model for the default document header.
|
2009-06-03 23:38:52 -04:00
|
|
|
* <p/>
|
2008-11-14 15:29:42 -05:00
|
|
|
* Note that XSSF offers more kinds of document headers than HSSF does
|
|
|
|
* </p>
|
2009-06-03 23:38:52 -04:00
|
|
|
* @return the document header. Never <code>null</code>
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
Header getHeader();
|
|
|
|
|
|
|
|
/**
|
2009-06-03 20:06:31 -04:00
|
|
|
* Gets the user model for the default document footer.
|
2009-06-03 23:38:52 -04:00
|
|
|
* <p/>
|
2008-11-14 15:29:42 -05:00
|
|
|
* Note that XSSF offers more kinds of document footers than HSSF does.
|
|
|
|
*
|
2009-06-03 23:38:52 -04:00
|
|
|
* @return the document footer. Never <code>null</code>
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
Footer getFooter();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Sets a flag indicating whether this sheet is selected.
|
|
|
|
*<p>
|
|
|
|
* Note: multiple sheets can be selected, but only one sheet can be active at one time.
|
|
|
|
*</p>
|
|
|
|
* @param value <code>true</code> if this sheet is selected
|
|
|
|
* @see Workbook#setActiveSheet(int)
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setSelected(boolean value);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the size of the margin in inches.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param margin which margin to get
|
|
|
|
* @return the size of the margin
|
|
|
|
*/
|
|
|
|
double getMargin(short margin);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the size of the margin in inches.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param margin which margin to get
|
|
|
|
* @param size the size of the margin
|
|
|
|
*/
|
|
|
|
void setMargin(short margin, double size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Answer whether protection is enabled or disabled
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return true => protection enabled; false => protection disabled
|
|
|
|
*/
|
|
|
|
boolean getProtect();
|
2010-08-18 08:49:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the protection enabled as well as the password
|
|
|
|
* @param password to set for protection. Pass <code>null</code> to remove protection
|
|
|
|
*/
|
|
|
|
public void protectSheet(String password);
|
|
|
|
|
2008-01-16 11:08:22 -05:00
|
|
|
/**
|
|
|
|
* Answer whether scenario protection is enabled or disabled
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return true => protection enabled; false => protection disabled
|
|
|
|
*/
|
|
|
|
boolean getScenarioProtect();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the zoom magnication for the sheet. The zoom is expressed as a
|
|
|
|
* fraction. For example to express a zoom of 75% use 3 for the numerator
|
|
|
|
* and 4 for the denominator.
|
|
|
|
*
|
|
|
|
* @param numerator The numerator for the zoom magnification.
|
|
|
|
* @param denominator The denominator for the zoom magnification.
|
|
|
|
*/
|
|
|
|
void setZoom(int numerator, int denominator);
|
|
|
|
|
|
|
|
/**
|
2009-06-03 23:38:52 -04:00
|
|
|
* The top row in the visible view when the sheet is
|
2008-11-14 15:29:42 -05:00
|
|
|
* first viewed after opening it in a viewer
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return short indicating the rownum (0 based) of the top row
|
|
|
|
*/
|
|
|
|
short getTopRow();
|
|
|
|
|
|
|
|
/**
|
2009-06-03 23:38:52 -04:00
|
|
|
* The left col in the visible view when the sheet is
|
2008-11-14 15:29:42 -05:00
|
|
|
* first viewed after opening it in a viewer
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return short indicating the rownum (0 based) of the top row
|
|
|
|
*/
|
|
|
|
short getLeftCol();
|
|
|
|
|
|
|
|
/**
|
2009-06-03 23:38:52 -04:00
|
|
|
* Sets desktop window pane display area, when the
|
2008-01-16 11:08:22 -05:00
|
|
|
* file is first opened in a viewer.
|
2008-11-14 15:29:42 -05:00
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param toprow the top row to show in desktop window pane
|
|
|
|
* @param leftcol the left column to show in desktop window pane
|
|
|
|
*/
|
|
|
|
void showInPane(short toprow, short leftcol);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shifts rows between startRow and endRow n number of rows.
|
|
|
|
* If you use a negative number, it will shift rows up.
|
|
|
|
* Code ensures that rows don't wrap around.
|
|
|
|
*
|
|
|
|
* Calls shiftRows(startRow, endRow, n, false, false);
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Additionally shifts merged regions that are completely defined in these
|
|
|
|
* rows (ie. merged 2 cells on a row to be shifted).
|
|
|
|
* @param startRow the row to start shifting
|
|
|
|
* @param endRow the row to end shifting
|
|
|
|
* @param n the number of rows to shift
|
|
|
|
*/
|
|
|
|
void shiftRows(int startRow, int endRow, int n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shifts rows between startRow and endRow n number of rows.
|
|
|
|
* If you use a negative number, it will shift rows up.
|
|
|
|
* Code ensures that rows don't wrap around
|
|
|
|
*
|
|
|
|
* <p>
|
|
|
|
* Additionally shifts merged regions that are completely defined in these
|
|
|
|
* rows (ie. merged 2 cells on a row to be shifted).
|
|
|
|
* <p>
|
|
|
|
* @param startRow the row to start shifting
|
|
|
|
* @param endRow the row to end shifting
|
|
|
|
* @param n the number of rows to shift
|
|
|
|
* @param copyRowHeight whether to copy the row height during the shift
|
|
|
|
* @param resetOriginalRowHeight whether to set the original row's height to the default
|
|
|
|
*/
|
|
|
|
void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
|
2011-06-25 08:19:49 -04:00
|
|
|
* <p>
|
|
|
|
* If both colSplit and rowSplit are zero then the existing freeze pane is removed
|
|
|
|
* </p>
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param colSplit Horizonatal position of split.
|
|
|
|
* @param rowSplit Vertical position of split.
|
|
|
|
* @param leftmostColumn Left column visible in right pane.
|
2010-06-04 11:41:32 -04:00
|
|
|
* @param topRow Top row visible in bottom pane
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
|
2011-06-25 08:19:49 -04:00
|
|
|
* <p>
|
|
|
|
* If both colSplit and rowSplit are zero then the existing freeze pane is removed
|
|
|
|
* </p>
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param colSplit Horizonatal position of split.
|
|
|
|
* @param rowSplit Vertical position of split.
|
|
|
|
*/
|
|
|
|
void createFreezePane(int colSplit, int rowSplit);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a split pane. Any existing freezepane or split pane is overwritten.
|
|
|
|
* @param xSplitPos Horizonatal position of split (in 1/20th of a point).
|
|
|
|
* @param ySplitPos Vertical position of split (in 1/20th of a point).
|
|
|
|
* @param topRow Top row visible in bottom pane
|
|
|
|
* @param leftmostColumn Left column visible in right pane.
|
|
|
|
* @param activePane Active pane. One of: PANE_LOWER_RIGHT,
|
|
|
|
* PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
|
|
|
|
* @see #PANE_LOWER_LEFT
|
|
|
|
* @see #PANE_LOWER_RIGHT
|
|
|
|
* @see #PANE_UPPER_LEFT
|
|
|
|
* @see #PANE_UPPER_RIGHT
|
|
|
|
*/
|
|
|
|
void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns the information regarding the currently configured pane (split or freeze)
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return null if no pane configured, or the pane information.
|
|
|
|
*/
|
|
|
|
PaneInformation getPaneInformation();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Sets whether the gridlines are shown in a viewer
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param show whether to show gridlines or not
|
|
|
|
*/
|
|
|
|
void setDisplayGridlines(boolean show);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns if gridlines are displayed
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return whether gridlines are displayed
|
|
|
|
*/
|
|
|
|
boolean isDisplayGridlines();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Sets whether the formulas are shown in a viewer
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param show whether to show formulas or not
|
|
|
|
*/
|
|
|
|
void setDisplayFormulas(boolean show);
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Returns if formulas are displayed
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @return whether formulas are displayed
|
|
|
|
*/
|
|
|
|
boolean isDisplayFormulas();
|
|
|
|
|
|
|
|
/**
|
2008-11-14 15:29:42 -05:00
|
|
|
* Sets whether the RowColHeadings are shown in a viewer
|
|
|
|
*
|
2008-01-16 11:08:22 -05:00
|
|
|
* @param show whether to show RowColHeadings or not
|
|
|
|
*/
|
|
|
|
void setDisplayRowColHeadings(boolean show);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns if RowColHeadings are displayed.
|
|
|
|
* @return whether RowColHeadings are displayed
|
|
|
|
*/
|
|
|
|
boolean isDisplayRowColHeadings();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a page break at the indicated row
|
2011-06-24 08:15:16 -04:00
|
|
|
* Breaks occur above the specified row and left of the specified column inclusive.
|
|
|
|
*
|
|
|
|
* For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
|
|
|
|
* with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code>
|
|
|
|
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
|
|
|
|
* and rows starting with rownum=4 in the second.
|
|
|
|
*
|
|
|
|
* @param row the row to break, inclusive
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
|
|
|
void setRowBreak(int row);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines if there is a page break at the indicated row
|
|
|
|
* @param row FIXME: Document this!
|
|
|
|
* @return FIXME: Document this!
|
|
|
|
*/
|
|
|
|
boolean isRowBroken(int row);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the page break at the indicated row
|
|
|
|
* @param row
|
|
|
|
*/
|
|
|
|
void removeRowBreak(int row);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves all the horizontal page breaks
|
|
|
|
* @return all the horizontal page breaks, or null if there are no row page breaks
|
|
|
|
*/
|
|
|
|
int[] getRowBreaks();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves all the vertical page breaks
|
|
|
|
* @return all the vertical page breaks, or null if there are no column page breaks
|
|
|
|
*/
|
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-675852,675854-676200,676202,676204,676206-676220,676222-676309,676311-676456,676458-676994,676996-677027,677030-677040,677042-677056,677058-677375,677377-677968,677970-677971,677973,677975-677994,677996-678286,678288-678538,678540-680393,680395-680469,680471-680529,680531-680852,680854-681529,681531-681571,681573-682224,682226,682228,682231-682281,682283-682335,682337-682507,682509,682512-682517,682519-682532,682534-682619,682622-682777,682779-682998,683000-683019,683021-683286 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r683023 | josh | 2008-08-06 00:03:33 +0100 (Wed, 06 Aug 2008) | 1 line
Fix JDK 1.4 compilation (after r682511 /bug 45538)
........
r683081 | josh | 2008-08-06 02:39:44 +0100 (Wed, 06 Aug 2008) | 1 line
refactoring aggregate records to a separate hierarchy. just starting
........
r683093 | josh | 2008-08-06 04:06:18 +0100 (Wed, 06 Aug 2008) | 1 line
should have been submitted with r683081
........
r683096 | josh | 2008-08-06 04:23:10 +0100 (Wed, 06 Aug 2008) | 1 line
should have been submitted with r683081
........
r683128 | josh | 2008-08-06 07:20:59 +0100 (Wed, 06 Aug 2008) | 1 line
removed TODO comment and formatted
........
r683132 | josh | 2008-08-06 07:27:39 +0100 (Wed, 06 Aug 2008) | 1 line
Partial fix for bug 45570 - Converted instance BitField fields to static
........
r683167 | josh | 2008-08-06 09:42:40 +0100 (Wed, 06 Aug 2008) | 1 line
Added conditional format records to BiffViewer
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@683670 13f79535-47bb-0310-9956-ffa450edef68
2008-08-07 14:21:32 -04:00
|
|
|
int[] getColumnBreaks();
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
2011-06-24 08:15:16 -04:00
|
|
|
* Sets a page break at the indicated column.
|
|
|
|
* Breaks occur above the specified row and left of the specified column inclusive.
|
|
|
|
*
|
|
|
|
* For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
|
|
|
|
* with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code>
|
|
|
|
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
|
|
|
|
* and rows starting with rownum=4 in the second.
|
|
|
|
*
|
|
|
|
* @param column the column to break, inclusive
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2009-03-27 07:50:52 -04:00
|
|
|
void setColumnBreak(int column);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determines if there is a page break at the indicated column
|
|
|
|
* @param column FIXME: Document this!
|
|
|
|
* @return FIXME: Document this!
|
|
|
|
*/
|
2009-03-27 07:50:52 -04:00
|
|
|
boolean isColumnBroken(int column);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes a page break at the indicated column
|
|
|
|
* @param column
|
|
|
|
*/
|
2009-03-27 07:50:52 -04:00
|
|
|
void removeColumnBreak(int column);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Expands or collapses a column group.
|
|
|
|
*
|
|
|
|
* @param columnNumber One of the columns in the group.
|
|
|
|
* @param collapsed true = collapse group, false = expand group.
|
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setColumnGroupCollapsed(int columnNumber, boolean collapsed);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create an outline for the provided column range.
|
|
|
|
*
|
|
|
|
* @param fromColumn beginning of the column range.
|
|
|
|
* @param toColumn end of the column range.
|
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void groupColumn(int fromColumn, int toColumn);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-11-14 15:29:42 -05:00
|
|
|
/**
|
|
|
|
* Ungroup a range of columns that were previously groupped
|
|
|
|
*
|
|
|
|
* @param fromColumn start column (0-based)
|
|
|
|
* @param toColumn end column (0-based)
|
|
|
|
*/
|
|
|
|
void ungroupColumn(int fromColumn, int toColumn);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
2008-11-14 06:56:41 -05:00
|
|
|
/**
|
|
|
|
* Tie a range of rows together so that they can be collapsed or expanded
|
|
|
|
*
|
|
|
|
* @param fromRow start row (0-based)
|
|
|
|
* @param toRow end row (0-based)
|
|
|
|
*/
|
2008-01-16 11:08:22 -05:00
|
|
|
void groupRow(int fromRow, int toRow);
|
|
|
|
|
2008-11-14 06:56:41 -05:00
|
|
|
/**
|
|
|
|
* Ungroup a range of rows that were previously groupped
|
|
|
|
*
|
|
|
|
* @param fromRow start row (0-based)
|
|
|
|
* @param toRow end row (0-based)
|
|
|
|
*/
|
2008-01-16 11:08:22 -05:00
|
|
|
void ungroupRow(int fromRow, int toRow);
|
|
|
|
|
2008-11-14 06:56:41 -05:00
|
|
|
/**
|
|
|
|
* Set view state of a groupped range of rows
|
|
|
|
*
|
|
|
|
* @param row start row of a groupped range of rows (0-based)
|
|
|
|
* @param collapse whether to expand/collapse the detail rows
|
|
|
|
*/
|
2008-01-16 11:08:22 -05:00
|
|
|
void setRowGroupCollapsed(int row, boolean collapse);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the default column style for a given column. POI will only apply this style to new cells added to the sheet.
|
|
|
|
*
|
|
|
|
* @param column the column index
|
|
|
|
* @param style the style to set
|
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void setDefaultColumnStyle(int column, CellStyle style);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adjusts the column width to fit the contents.
|
|
|
|
*
|
2008-11-14 15:29:42 -05:00
|
|
|
* <p>
|
|
|
|
* This process can be relatively slow on large sheets, so this should
|
|
|
|
* normally only be called once per column, at the end of your
|
|
|
|
* processing.
|
|
|
|
* </p>
|
|
|
|
* You can specify whether the content of merged cells should be considered or ignored.
|
|
|
|
* Default is to ignore merged cells.
|
|
|
|
*
|
|
|
|
* @param column the column index
|
|
|
|
*/
|
|
|
|
void autoSizeColumn(int column);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adjusts the column width to fit the contents.
|
|
|
|
* <p>
|
2008-01-16 11:08:22 -05:00
|
|
|
* This process can be relatively slow on large sheets, so this should
|
|
|
|
* normally only be called once per column, at the end of your
|
|
|
|
* processing.
|
2008-11-14 15:29:42 -05:00
|
|
|
* </p>
|
|
|
|
* You can specify whether the content of merged cells should be considered or ignored.
|
|
|
|
* Default is to ignore merged cells.
|
2008-01-16 11:08:22 -05:00
|
|
|
*
|
|
|
|
* @param column the column index
|
2008-11-14 15:29:42 -05:00
|
|
|
* @param useMergedCells whether to use the contents of merged cells when calculating the width of the column
|
2008-01-16 11:08:22 -05:00
|
|
|
*/
|
2008-11-14 15:29:42 -05:00
|
|
|
void autoSizeColumn(int column, boolean useMergedCells);
|
2008-01-16 11:08:22 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns cell comment for the specified row and column
|
|
|
|
*
|
|
|
|
* @return cell comment or <code>null</code> if not found
|
|
|
|
*/
|
|
|
|
Comment getCellComment(int row, int column);
|
|
|
|
|
2008-11-14 06:56:41 -05:00
|
|
|
/**
|
2013-07-15 17:45:21 -04:00
|
|
|
* Creates the top-level drawing patriarch.
|
|
|
|
* <p>This may then be used to add graphics or charts.</p>
|
|
|
|
* <p>Note that this will normally have the effect of removing
|
|
|
|
* any existing drawings on this sheet.</p>
|
2008-11-14 06:56:41 -05:00
|
|
|
*
|
|
|
|
* @return The new drawing patriarch.
|
|
|
|
*/
|
2008-11-12 02:15:37 -05:00
|
|
|
Drawing createDrawingPatriarch();
|
|
|
|
|
2008-12-17 13:55:07 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the parent workbook
|
|
|
|
*
|
|
|
|
* @return the parent workbook
|
|
|
|
*/
|
|
|
|
Workbook getWorkbook();
|
2009-03-27 07:50:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the name of this sheet
|
|
|
|
*
|
|
|
|
* @return the name of this sheet
|
|
|
|
*/
|
|
|
|
String getSheetName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note - this is not the same as whether the sheet is focused (isActive)
|
|
|
|
* @return <code>true</code> if this sheet is currently selected
|
|
|
|
*/
|
|
|
|
boolean isSelected();
|
|
|
|
|
2009-12-25 10:15:55 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets array formula to specified region for result.
|
|
|
|
*
|
2009-12-25 18:04:04 -05:00
|
|
|
* @param formula text representation of the formula
|
|
|
|
* @param range Region of array formula for result.
|
|
|
|
* @return the {@link CellRange} of cells affected by this change
|
2009-12-25 10:15:55 -05:00
|
|
|
*/
|
2009-12-25 18:04:04 -05:00
|
|
|
CellRange<? extends Cell> setArrayFormula(String formula, CellRangeAddress range);
|
2009-12-25 10:15:55 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a Array Formula from this sheet. All cells contained in the Array Formula range are removed as well
|
|
|
|
*
|
2009-12-25 18:04:04 -05:00
|
|
|
* @param cell any cell within Array Formula range
|
|
|
|
* @return the {@link CellRange} of cells affected by this change
|
2009-12-25 10:15:55 -05:00
|
|
|
*/
|
2009-12-25 18:04:04 -05:00
|
|
|
CellRange<? extends Cell> removeArrayFormula(Cell cell);
|
2010-05-16 11:49:21 -04:00
|
|
|
|
|
|
|
public DataValidationHelper getDataValidationHelper();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a data validation object
|
|
|
|
* @param dataValidation The Data validation object settings
|
|
|
|
*/
|
|
|
|
public void addValidationData(DataValidation dataValidation);
|
2010-08-08 07:11:38 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable filtering for a range of cells
|
|
|
|
*
|
|
|
|
* @param range the range of cells to filter
|
|
|
|
*/
|
|
|
|
AutoFilter setAutoFilter(CellRangeAddress range);
|
2011-07-29 00:47:25 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'Conditional Formatting' facet for this <tt>Sheet</tt>
|
|
|
|
*
|
|
|
|
* @return conditional formatting rule for this sheet
|
|
|
|
*/
|
|
|
|
SheetConditionalFormatting getSheetConditionalFormatting();
|
|
|
|
|
2012-07-21 06:33:00 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the repeating rows used when printing the sheet, as found in
|
|
|
|
* File->PageSetup->Sheet.
|
|
|
|
* <p/>
|
|
|
|
* Repeating rows cover a range of contiguous rows, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* Sheet1!$1:$1
|
|
|
|
* Sheet2!$5:$8
|
|
|
|
* </pre>
|
|
|
|
* The {@link CellRangeAddress} returned contains a column part which spans
|
|
|
|
* all columns, and a row part which specifies the contiguous range of
|
|
|
|
* repeating rows.
|
|
|
|
* <p/>
|
|
|
|
* If the Sheet does not have any repeating rows defined, null is returned.
|
|
|
|
*
|
|
|
|
* @return an {@link CellRangeAddress} containing the repeating rows for the
|
|
|
|
* Sheet, or null.
|
|
|
|
*/
|
|
|
|
CellRangeAddress getRepeatingRows();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the repeating columns used when printing the sheet, as found in
|
|
|
|
* File->PageSetup->Sheet.
|
|
|
|
* <p/>
|
|
|
|
* Repeating columns cover a range of contiguous columns, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* Sheet1!$A:$A
|
|
|
|
* Sheet2!$C:$F
|
|
|
|
* </pre>
|
|
|
|
* The {@link CellRangeAddress} returned contains a row part which spans all
|
|
|
|
* rows, and a column part which specifies the contiguous range of
|
|
|
|
* repeating columns.
|
|
|
|
* <p/>
|
|
|
|
* If the Sheet does not have any repeating columns defined, null is
|
|
|
|
* returned.
|
|
|
|
*
|
2012-08-04 04:51:49 -04:00
|
|
|
* @return an {@link CellRangeAddress} containing the repeating columns for
|
|
|
|
* the Sheet, or null.
|
2012-07-21 06:33:00 -04:00
|
|
|
*/
|
|
|
|
CellRangeAddress getRepeatingColumns();
|
|
|
|
|
|
|
|
|
2012-08-04 04:51:49 -04:00
|
|
|
/**
|
|
|
|
* Sets the repeating rows used when printing the sheet, as found in
|
|
|
|
* File->PageSetup->Sheet.
|
|
|
|
* <p/>
|
|
|
|
* Repeating rows cover a range of contiguous rows, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* Sheet1!$1:$1
|
|
|
|
* Sheet2!$5:$8</pre>
|
|
|
|
* The parameter {@link CellRangeAddress} should specify a column part
|
|
|
|
* which spans all columns, and a row part which specifies the contiguous
|
|
|
|
* range of repeating rows, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* sheet.setRepeatingRows(CellRangeAddress.valueOf("2:3"));</pre>
|
|
|
|
* A null parameter value indicates that repeating rows should be removed
|
|
|
|
* from the Sheet:
|
|
|
|
* <pre>
|
|
|
|
* sheet.setRepeatingRows(null);</pre>
|
|
|
|
*
|
|
|
|
* @param rowRangeRef a {@link CellRangeAddress} containing the repeating
|
|
|
|
* rows for the Sheet, or null.
|
|
|
|
*/
|
|
|
|
void setRepeatingRows(CellRangeAddress rowRangeRef);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the repeating columns used when printing the sheet, as found in
|
|
|
|
* File->PageSetup->Sheet.
|
|
|
|
* <p/>
|
|
|
|
* Repeating columns cover a range of contiguous columns, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* Sheet1!$A:$A
|
|
|
|
* Sheet2!$C:$F</pre>
|
|
|
|
* The parameter {@link CellRangeAddress} should specify a row part
|
|
|
|
* which spans all rows, and a column part which specifies the contiguous
|
|
|
|
* range of repeating columns, e.g.:
|
|
|
|
* <pre>
|
|
|
|
* sheet.setRepeatingColumns(CellRangeAddress.valueOf("B:C"));</pre>
|
|
|
|
* A null parameter value indicates that repeating columns should be removed
|
|
|
|
* from the Sheet:
|
|
|
|
* <pre>
|
|
|
|
* sheet.setRepeatingColumns(null);</pre>
|
|
|
|
*
|
|
|
|
* @param columnRangeRef a {@link CellRangeAddress} containing the repeating
|
|
|
|
* columns for the Sheet, or null.
|
|
|
|
*/
|
|
|
|
void setRepeatingColumns(CellRangeAddress columnRangeRef);
|
|
|
|
|
2008-01-21 13:00:30 -05:00
|
|
|
}
|