Package loci.poi.hssf.usermodel
Class HSSFSheet
- java.lang.Object
-
- loci.poi.hssf.usermodel.HSSFSheet
-
public class HSSFSheet extends Object
High level representation of a worksheet.- Author:
- Andrew C. Oliver (acoliver at apache dot org), Glen Stampoultzis (glens at apache.org), Libin Roman (romal at vistaportal.com), Shawn Laubach (slaubach at apache dot org) (Just a little), Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little, too), Yegor Kozlov (yegor at apache.org) (Autosizing columns)
-
-
Field Summary
Fields Modifier and Type Field Description protected Workbook
book
static short
BottomMargin
static int
INITIAL_CAPACITY
Used for compile-time optimization.static short
LeftMargin
static byte
PANE_LOWER_LEFT
static byte
PANE_LOWER_RIGHT
static byte
PANE_UPPER_LEFT
static byte
PANE_UPPER_RIGHT
static short
RightMargin
static short
TopMargin
protected HSSFWorkbook
workbook
-
Constructor Summary
Constructors Modifier Constructor Description protected
HSSFSheet(HSSFWorkbook workbook)
Creates new HSSFSheet - called by HSSFWorkbook to create a sheet from scratch.protected
HSSFSheet(HSSFWorkbook workbook, Sheet sheet)
Creates an HSSFSheet representing the given Sheet object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
addMergedRegion(Region region)
adds a merged region of cells (hence those cells form one)void
autoSizeColumn(short column)
Adjusts the column width to fit the contents.HSSFPatriarch
createDrawingPatriarch()
Creates the toplevel drawing patriarch.void
createFreezePane(int colSplit, int rowSplit)
Creates a split (freezepane).void
createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
Creates a split (freezepane).HSSFRow
createRow(int rownum)
Create a new row within the sheet and return the high level representationvoid
createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
Creates a split pane.void
dumpDrawingRecords(boolean fat)
Aggregates the drawing records and dumps the escher record hierarchy to the standard output.boolean
getAlternateExpression()
whether alternate expression evaluation is onboolean
getAlternateFormula()
whether alternative formula entry is onboolean
getAutobreaks()
show automatic page breaks or notHSSFComment
getCellComment(int row, int column)
Returns cell comment for the specified row and columnshort[]
getColumnBreaks()
Retrieves all the vertical page breaksshort
getColumnWidth(short column)
get the width (in units of 1/256th of a character width )short
getDefaultColumnWidth()
get the default column width for the sheet (if the columns do not define their own width) in charactersshort
getDefaultRowHeight()
get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)float
getDefaultRowHeightInPoints()
get the default row height for the sheet (if the rows do not define their own height) in points.boolean
getDialog()
get whether sheet is a dialog sheet or notboolean
getDisplayGuts()
get whether to display the guts or notint
getFirstRowNum()
gets the first row on the sheetboolean
getFitToPage()
fit to page option is onHSSFFooter
getFooter()
Gets the user model for the document footer.HSSFHeader
getHeader()
Gets the user model for the document header.boolean
getHorizontallyCenter()
Determine whether printed output for this sheet will be horizontally centered.int
getLastRowNum()
gets the last row on the sheetshort
getLeftCol()
The left col in the visible view when the sheet is first viewed after opening it in a viewerdouble
getMargin(short margin)
Gets the size of the margin in inches.Region
getMergedRegionAt(int index)
gets the region at a particular indexint
getNumMergedRegions()
returns the number of merged regionsboolean
getObjectProtect()
Answer whether object protection is enabled or disabledPaneInformation
getPaneInformation()
Returns the information regarding the currently configured pane (split or freeze).short
getPassword()
int
getPhysicalNumberOfRows()
Returns the number of phsyically defined rows (NOT the number of rows in the sheet)HSSFPrintSetup
getPrintSetup()
Gets the print setup object.boolean
getProtect()
Answer whether protection is enabled or disabledHSSFRow
getRow(int rownum)
Returns the logical row (not physical) 0-based.int[]
getRowBreaks()
Retrieves all the horizontal page breaksboolean
getRowSumsBelow()
get if row summaries appear below detail in the outlineboolean
getRowSumsRight()
get if col summaries appear right of the detail in the outlineboolean
getScenarioProtect()
Answer whether scenario protection is enabled or disabledprotected Sheet
getSheet()
used internally in the API to get the low level Sheet record represented by this Object.short
getTopRow()
The top row in the visible view when the sheet is first viewed after opening it in a viewerboolean
getVerticallyCenter(boolean value)
Determine whether printed output for this sheet will be vertically centered.void
groupColumn(short fromColumn, short toColumn)
Create an outline for the provided column range.void
groupRow(int fromRow, int toRow)
protected void
insertChartRecords(List records)
boolean
isColumnBroken(short column)
Determines if there is a page break at the indicated columnboolean
isColumnHidden(short column)
Get the hidden state for a given column.boolean
isDisplayFormulas()
Returns if formulas are displayed.boolean
isDisplayGridlines()
Returns if gridlines are displayed.boolean
isDisplayRowColHeadings()
Returns if RowColHeadings are displayed.boolean
isGridsPrinted()
get whether gridlines are printed.boolean
isPrintGridlines()
Returns whether gridlines are printed.boolean
isRowBroken(int row)
Determines if there is a page break at the indicated rowvoid
protectSheet(String password)
Sets the protection enabled as well as the passwordvoid
removeColumnBreak(short column)
Removes a page break at the indicated columnvoid
removeMergedRegion(int index)
removes a merged region of cells (hence letting them free)void
removeRow(HSSFRow row)
Remove a row from this sheet.void
removeRowBreak(int row)
Removes the page break at the indicated rowIterator
rowIterator()
void
setAlternativeExpression(boolean b)
whether alternate expression evaluation is onvoid
setAlternativeFormula(boolean b)
whether alternative formula entry is onvoid
setAutobreaks(boolean b)
show automatic page breaks or notvoid
setColumnBreak(short column)
Sets a page break at the indicated columnvoid
setColumnGroupCollapsed(short columnNumber, boolean collapsed)
Expands or collapses a column group.void
setColumnHidden(short column, boolean hidden)
Get the visibility state for a given column.void
setColumnWidth(short column, short width)
set the width (in units of 1/256th of a character width)void
setDefaultColumnStyle(short column, HSSFCellStyle style)
Sets the default column style for a given column.void
setDefaultColumnWidth(short width)
set the default column width for the sheet (if the columns do not define their own width) in charactersvoid
setDefaultRowHeight(short height)
set the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)void
setDefaultRowHeightInPoints(float height)
set the default row height for the sheet (if the rows do not define their own height) in pointsvoid
setDialog(boolean b)
set whether sheet is a dialog sheet or notvoid
setDisplayFormulas(boolean show)
Sets whether the formulas are shown in a viewer.void
setDisplayGridlines(boolean show)
Sets whether the gridlines are shown in a viewer.void
setDisplayGuts(boolean b)
set whether to display the guts or notvoid
setDisplayRowColHeadings(boolean show)
Sets whether the RowColHeadings are shown in a viewer.void
setFitToPage(boolean b)
fit to page option is onvoid
setGridsPrinted(boolean value)
set whether gridlines printed.void
setHorizontallyCenter(boolean value)
determines whether the output is horizontally centered on the page.void
setMargin(short margin, double size)
Sets the size of the margin in inches.void
setPrintGridlines(boolean newPrintGridlines)
Turns on or off the printing of gridlines.void
setProtect(boolean protect)
Deprecated.use protectSheet(String, boolean, boolean)void
setRowBreak(int row)
Sets a page break at the indicated rowvoid
setRowGroupCollapsed(int row, boolean collapse)
void
setRowSumsBelow(boolean b)
set if row summaries appear below detail in the outlinevoid
setRowSumsRight(boolean b)
set if col summaries appear right of the detail in the outlinevoid
setSelected(boolean sel)
Sets whether sheet is selected.void
setVerticallyCenter(boolean value)
determines whether the output is vertically centered on the page.void
setZoom(int numerator, int denominator)
Sets the zoom magnication for the sheet.protected void
shiftMerged(int startRow, int endRow, int n, boolean isRow)
Shifts the merged regions left or right depending on modevoid
shiftRows(int startRow, int endRow, int n)
Shifts rows between startRow and endRow n number of rows.void
shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
Shifts rows between startRow and endRow n number of rows.void
showInPane(short toprow, short leftcol)
Sets desktop window pane display area, when the file is first opened in a viewer.void
ungroupColumn(short fromColumn, short toColumn)
void
ungroupRow(int fromRow, int toRow)
protected void
validateColumn(short column)
Runs a bounds check for column numbersprotected void
validateRow(int row)
Runs a bounds check for row numbers
-
-
-
Field Detail
-
LeftMargin
public static final short LeftMargin
- See Also:
- Constant Field Values
-
RightMargin
public static final short RightMargin
- See Also:
- Constant Field Values
-
TopMargin
public static final short TopMargin
- See Also:
- Constant Field Values
-
BottomMargin
public static final short BottomMargin
- See Also:
- Constant Field Values
-
PANE_LOWER_RIGHT
public static final byte PANE_LOWER_RIGHT
- See Also:
- Constant Field Values
-
PANE_UPPER_RIGHT
public static final byte PANE_UPPER_RIGHT
- See Also:
- Constant Field Values
-
PANE_LOWER_LEFT
public static final byte PANE_LOWER_LEFT
- See Also:
- Constant Field Values
-
PANE_UPPER_LEFT
public static final byte PANE_UPPER_LEFT
- See Also:
- Constant Field Values
-
INITIAL_CAPACITY
public static final int INITIAL_CAPACITY
Used for compile-time optimization. This is the initial size for the collection of rows. It is currently set to 20. If you generate larger sheets you may benefit by setting this to a higher number and recompiling a custom edition of HSSFSheet.- See Also:
- Constant Field Values
-
book
protected Workbook book
-
workbook
protected HSSFWorkbook workbook
-
-
Constructor Detail
-
HSSFSheet
protected HSSFSheet(HSSFWorkbook workbook)
Creates new HSSFSheet - called by HSSFWorkbook to create a sheet from scratch. You should not be calling this from application code (its protected anyhow).- Parameters:
workbook
- - The HSSF Workbook object associated with the sheet.- See Also:
HSSFWorkbook.createSheet()
-
HSSFSheet
protected HSSFSheet(HSSFWorkbook workbook, Sheet sheet)
Creates an HSSFSheet representing the given Sheet object. Should only be called by HSSFWorkbook when reading in an exisiting file.- Parameters:
workbook
- - The HSSF Workbook object associated with the sheet.sheet
- - lowlevel Sheet object this sheet will represent- See Also:
HSSFWorkbook.createSheet()
-
-
Method Detail
-
createRow
public HSSFRow createRow(int rownum)
Create a new row within the sheet and return the high level representation- Parameters:
rownum
- row number- Returns:
- High level HSSFRow object representing a row in the sheet
- See Also:
HSSFRow
,removeRow(HSSFRow)
-
removeRow
public void removeRow(HSSFRow row)
Remove a row from this sheet. All cells contained in the row are removed as well- Parameters:
row
- representing a row to remove.
-
getRow
public HSSFRow getRow(int rownum)
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.- Parameters:
rownum
- row to get- Returns:
- HSSFRow representing the rownumber or null if its not defined on the sheet
-
getPhysicalNumberOfRows
public int getPhysicalNumberOfRows()
Returns the number of phsyically defined rows (NOT the number of rows in the sheet)
-
getFirstRowNum
public int getFirstRowNum()
gets the first row on the sheet- Returns:
- the number of the first logical row on the sheet
-
getLastRowNum
public int getLastRowNum()
gets the last row on the sheet- Returns:
- last row contained n this sheet.
-
setColumnHidden
public void setColumnHidden(short column, boolean hidden)
Get the visibility state for a given column.- Parameters:
column
- - the column to get (0-based)hidden
- - the visiblity state of the column
-
isColumnHidden
public boolean isColumnHidden(short column)
Get the hidden state for a given column.- Parameters:
column
- - the column to set (0-based)- Returns:
- hidden - the visiblity state of the column
-
setColumnWidth
public void setColumnWidth(short column, short width)
set the width (in units of 1/256th of a character width)- Parameters:
column
- - the column to set (0-based)width
- - the width in units of 1/256th of a character width
-
getColumnWidth
public short getColumnWidth(short column)
get the width (in units of 1/256th of a character width )- Parameters:
column
- - the column to set (0-based)- Returns:
- width - the width in units of 1/256th of a character width
-
getDefaultColumnWidth
public short getDefaultColumnWidth()
get the default column width for the sheet (if the columns do not define their own width) in characters- Returns:
- default column width
-
getDefaultRowHeight
public short getDefaultRowHeight()
get the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)- Returns:
- default row height
-
getDefaultRowHeightInPoints
public float getDefaultRowHeightInPoints()
get the default row height for the sheet (if the rows do not define their own height) in points.- Returns:
- default row height in points
-
setDefaultColumnWidth
public void setDefaultColumnWidth(short width)
set the default column width for the sheet (if the columns do not define their own width) in characters- Parameters:
width
- default column width
-
setDefaultRowHeight
public void setDefaultRowHeight(short height)
set the default row height for the sheet (if the rows do not define their own height) in twips (1/20 of a point)- Parameters:
height
- default row height
-
setDefaultRowHeightInPoints
public void setDefaultRowHeightInPoints(float height)
set the default row height for the sheet (if the rows do not define their own height) in points- Parameters:
height
- default row height
-
isGridsPrinted
public boolean isGridsPrinted()
get whether gridlines are printed.- Returns:
- true if printed
-
setGridsPrinted
public void setGridsPrinted(boolean value)
set whether gridlines printed.- Parameters:
value
- false if not printed.
-
addMergedRegion
public int addMergedRegion(Region region)
adds a merged region of cells (hence those cells form one)- Parameters:
region
- (rowfrom/colfrom-rowto/colto) to merge- Returns:
- index of this region
-
setVerticallyCenter
public void setVerticallyCenter(boolean value)
determines whether the output is vertically centered on the page.- Parameters:
value
- true to vertically center, false otherwise.
-
getVerticallyCenter
public boolean getVerticallyCenter(boolean value)
Determine whether printed output for this sheet will be vertically centered.
-
setHorizontallyCenter
public void setHorizontallyCenter(boolean value)
determines whether the output is horizontally centered on the page.- Parameters:
value
- true to horizontally center, false otherwise.
-
getHorizontallyCenter
public boolean getHorizontallyCenter()
Determine whether printed output for this sheet will be horizontally centered.
-
removeMergedRegion
public void removeMergedRegion(int index)
removes a merged region of cells (hence letting them free)- Parameters:
index
- of the region to unmerge
-
getNumMergedRegions
public int getNumMergedRegions()
returns the number of merged regions- Returns:
- number of merged regions
-
getMergedRegionAt
public Region getMergedRegionAt(int index)
gets the region at a particular index- Parameters:
index
- of the region to fetch- Returns:
- the merged region (simple eh?)
-
rowIterator
public Iterator rowIterator()
- Returns:
- 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.
-
getSheet
protected Sheet getSheet()
used internally in the API to get the low level Sheet record represented by this Object.- Returns:
- Sheet - low level representation of this HSSFSheet.
-
setAlternativeExpression
public void setAlternativeExpression(boolean b)
whether alternate expression evaluation is on- Parameters:
b
- alternative expression evaluation or not
-
setAlternativeFormula
public void setAlternativeFormula(boolean b)
whether alternative formula entry is on- Parameters:
b
- alternative formulas or not
-
setAutobreaks
public void setAutobreaks(boolean b)
show automatic page breaks or not- Parameters:
b
- whether to show auto page breaks
-
setDialog
public void setDialog(boolean b)
set whether sheet is a dialog sheet or not- Parameters:
b
- isDialog or not
-
setDisplayGuts
public void setDisplayGuts(boolean b)
set whether to display the guts or not- Parameters:
b
- guts or no guts (or glory)
-
setFitToPage
public void setFitToPage(boolean b)
fit to page option is on- Parameters:
b
- fit or not
-
setRowSumsBelow
public void setRowSumsBelow(boolean b)
set if row summaries appear below detail in the outline- Parameters:
b
- below or not
-
setRowSumsRight
public void setRowSumsRight(boolean b)
set if col summaries appear right of the detail in the outline- Parameters:
b
- right or not
-
getAlternateExpression
public boolean getAlternateExpression()
whether alternate expression evaluation is on- Returns:
- alternative expression evaluation or not
-
getAlternateFormula
public boolean getAlternateFormula()
whether alternative formula entry is on- Returns:
- alternative formulas or not
-
getAutobreaks
public boolean getAutobreaks()
show automatic page breaks or not- Returns:
- whether to show auto page breaks
-
getDialog
public boolean getDialog()
get whether sheet is a dialog sheet or not- Returns:
- isDialog or not
-
getDisplayGuts
public boolean getDisplayGuts()
get whether to display the guts or not- Returns:
- guts or no guts (or glory)
-
getFitToPage
public boolean getFitToPage()
fit to page option is on- Returns:
- fit or not
-
getRowSumsBelow
public boolean getRowSumsBelow()
get if row summaries appear below detail in the outline- Returns:
- below or not
-
getRowSumsRight
public boolean getRowSumsRight()
get if col summaries appear right of the detail in the outline- Returns:
- right or not
-
isPrintGridlines
public boolean isPrintGridlines()
Returns whether gridlines are printed.- Returns:
- Gridlines are printed
-
setPrintGridlines
public void setPrintGridlines(boolean newPrintGridlines)
Turns on or off the printing of gridlines.- Parameters:
newPrintGridlines
- boolean to turn on or off the printing of gridlines
-
getPrintSetup
public HSSFPrintSetup getPrintSetup()
Gets the print setup object.- Returns:
- The user model for the print setup object.
-
getHeader
public HSSFHeader getHeader()
Gets the user model for the document header.- Returns:
- The Document header.
-
getFooter
public HSSFFooter getFooter()
Gets the user model for the document footer.- Returns:
- The Document footer.
-
setSelected
public void setSelected(boolean sel)
Sets whether sheet is selected.- Parameters:
sel
- Whether to select the sheet or deselect the sheet.
-
getMargin
public double getMargin(short margin)
Gets the size of the margin in inches.- Parameters:
margin
- which margin to get- Returns:
- the size of the margin
-
setMargin
public void setMargin(short margin, double size)
Sets the size of the margin in inches.- Parameters:
margin
- which margin to getsize
- the size of the margin
-
getProtect
public boolean getProtect()
Answer whether protection is enabled or disabled- Returns:
- true => protection enabled; false => protection disabled
-
getPassword
public short getPassword()
- Returns:
- hashed password
-
getObjectProtect
public boolean getObjectProtect()
Answer whether object protection is enabled or disabled- Returns:
- true => protection enabled; false => protection disabled
-
getScenarioProtect
public boolean getScenarioProtect()
Answer whether scenario protection is enabled or disabled- Returns:
- true => protection enabled; false => protection disabled
-
setProtect
public void setProtect(boolean protect)
Deprecated.use protectSheet(String, boolean, boolean)Sets the protection on enabled or disabled- Parameters:
protect
- true => protection enabled; false => protection disabled
-
protectSheet
public void protectSheet(String password)
Sets the protection enabled as well as the password- Parameters:
password
- to set for protection
-
setZoom
public void setZoom(int numerator, int denominator)
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.- Parameters:
numerator
- The numerator for the zoom magnification.denominator
- The denominator for the zoom magnification.
-
getTopRow
public short getTopRow()
The top row in the visible view when the sheet is first viewed after opening it in a viewer- Returns:
- short indicating the rownum (0 based) of the top row
-
getLeftCol
public short getLeftCol()
The left col in the visible view when the sheet is first viewed after opening it in a viewer- Returns:
- short indicating the rownum (0 based) of the top row
-
showInPane
public void showInPane(short toprow, short leftcol)
Sets desktop window pane display area, when the file is first opened in a viewer.- Parameters:
toprow
- the top row to show in desktop window paneleftcol
- the left column to show in desktop window pane
-
shiftMerged
protected void shiftMerged(int startRow, int endRow, int n, boolean isRow)
Shifts the merged regions left or right depending on modeTODO: MODE , this is only row specific
- Parameters:
startRow
-endRow
-n
-isRow
-
-
shiftRows
public 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. Calls shiftRows(startRow, endRow, n, false, false);Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).
- Parameters:
startRow
- the row to start shiftingendRow
- the row to end shiftingn
- the number of rows to shift
-
shiftRows
public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight)
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 aroundAdditionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted).
TODO Might want to add bounds checking here
- Parameters:
startRow
- the row to start shiftingendRow
- the row to end shiftingn
- the number of rows to shiftcopyRowHeight
- whether to copy the row height during the shiftresetOriginalRowHeight
- whether to set the original row's height to the default
-
insertChartRecords
protected void insertChartRecords(List records)
-
createFreezePane
public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow)
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.- Parameters:
colSplit
- Horizonatal position of split.rowSplit
- Vertical position of split.topRow
- Top row visible in bottom paneleftmostColumn
- Left column visible in right pane.
-
createFreezePane
public void createFreezePane(int colSplit, int rowSplit)
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.- Parameters:
colSplit
- Horizonatal position of split.rowSplit
- Vertical position of split.
-
createSplitPane
public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane)
Creates a split pane. Any existing freezepane or split pane is overwritten.- Parameters:
xSplitPos
- Horizonatal position of split (in 1/20th of a point).ySplitPos
- Vertical position of split (in 1/20th of a point).topRow
- Top row visible in bottom paneleftmostColumn
- Left column visible in right pane.activePane
- Active pane. One of: PANE_LOWER_RIGHT, PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT- See Also:
PANE_LOWER_LEFT
,PANE_LOWER_RIGHT
,PANE_UPPER_LEFT
,PANE_UPPER_RIGHT
-
getPaneInformation
public PaneInformation getPaneInformation()
Returns the information regarding the currently configured pane (split or freeze).- Returns:
- null if no pane configured, or the pane information.
-
setDisplayGridlines
public void setDisplayGridlines(boolean show)
Sets whether the gridlines are shown in a viewer.- Parameters:
show
- whether to show gridlines or not
-
isDisplayGridlines
public boolean isDisplayGridlines()
Returns if gridlines are displayed.- Returns:
- whether gridlines are displayed
-
setDisplayFormulas
public void setDisplayFormulas(boolean show)
Sets whether the formulas are shown in a viewer.- Parameters:
show
- whether to show formulas or not
-
isDisplayFormulas
public boolean isDisplayFormulas()
Returns if formulas are displayed.- Returns:
- whether formulas are displayed
-
setDisplayRowColHeadings
public void setDisplayRowColHeadings(boolean show)
Sets whether the RowColHeadings are shown in a viewer.- Parameters:
show
- whether to show RowColHeadings or not
-
isDisplayRowColHeadings
public boolean isDisplayRowColHeadings()
Returns if RowColHeadings are displayed.- Returns:
- whether RowColHeadings are displayed
-
setRowBreak
public void setRowBreak(int row)
Sets a page break at the indicated row- Parameters:
row
- FIXME: Document this!
-
isRowBroken
public boolean isRowBroken(int row)
Determines if there is a page break at the indicated row- Parameters:
row
- FIXME: Document this!- Returns:
- FIXME: Document this!
-
removeRowBreak
public void removeRowBreak(int row)
Removes the page break at the indicated row- Parameters:
row
-
-
getRowBreaks
public int[] getRowBreaks()
Retrieves all the horizontal page breaks- Returns:
- all the horizontal page breaks, or null if there are no row page breaks
-
getColumnBreaks
public short[] getColumnBreaks()
Retrieves all the vertical page breaks- Returns:
- all the vertical page breaks, or null if there are no column page breaks
-
setColumnBreak
public void setColumnBreak(short column)
Sets a page break at the indicated column- Parameters:
column
-
-
isColumnBroken
public boolean isColumnBroken(short column)
Determines if there is a page break at the indicated column- Parameters:
column
- FIXME: Document this!- Returns:
- FIXME: Document this!
-
removeColumnBreak
public void removeColumnBreak(short column)
Removes a page break at the indicated column- Parameters:
column
-
-
validateRow
protected void validateRow(int row)
Runs a bounds check for row numbers- Parameters:
row
-
-
validateColumn
protected void validateColumn(short column)
Runs a bounds check for column numbers- Parameters:
column
-
-
dumpDrawingRecords
public void dumpDrawingRecords(boolean fat)
Aggregates the drawing records and dumps the escher record hierarchy to the standard output.
-
createDrawingPatriarch
public HSSFPatriarch createDrawingPatriarch()
Creates the toplevel drawing patriarch. This will have the effect of removing any existing drawings on this sheet.- Returns:
- The new patriarch.
-
setColumnGroupCollapsed
public void setColumnGroupCollapsed(short columnNumber, boolean collapsed)
Expands or collapses a column group.- Parameters:
columnNumber
- One of the columns in the group.collapsed
- true = collapse group, false = expand group.
-
groupColumn
public void groupColumn(short fromColumn, short toColumn)
Create an outline for the provided column range.- Parameters:
fromColumn
- beginning of the column range.toColumn
- end of the column range.
-
ungroupColumn
public void ungroupColumn(short fromColumn, short toColumn)
-
groupRow
public void groupRow(int fromRow, int toRow)
-
ungroupRow
public void ungroupRow(int fromRow, int toRow)
-
setRowGroupCollapsed
public void setRowGroupCollapsed(int row, boolean collapse)
-
setDefaultColumnStyle
public void setDefaultColumnStyle(short column, HSSFCellStyle style)
Sets the default column style for a given column. POI will only apply this style to new cells added to the sheet.- Parameters:
column
- the column indexstyle
- the style to set
-
autoSizeColumn
public void autoSizeColumn(short column)
Adjusts the column width to fit the contents. 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.- Parameters:
column
- the column index
-
getCellComment
public HSSFComment getCellComment(int row, int column)
Returns cell comment for the specified row and column- Returns:
- cell comment or
null
if not found
-
-