| java.lang.Object org.apache.poi.hssf.model.Sheet
Sheet | public class Sheet implements Model(Code) | | Low level model implementation of a Sheet (one workbook contains many sheets)
This file contains the low level binary records starting at the sheets BOF and
ending with the sheets EOF. Use HSSFSheet for a high level representation.
The structures of the highlevel API use references to this to perform most of their
operations. Its probably unwise to use these low level structures directly unless you
really know what you're doing. I recommend you read the Microsoft Excel 97 Developer's
Kit (Microsoft Press) and the documentation at http://sc.openoffice.org/excelfileformat.pdf
before even attempting to use this.
author: Andrew C. Oliver (acoliver at apache dot org) author: Glen Stampoultzis (glens at apache.org) author: Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, PrintSetup, and Setting Default Column Styles author: Jason Height (jheight at chariot dot net dot au) Clone support. DBCell & Index Record writing support author: Brian Sanders (kestrel at burdell dot org) Active Cell support author: Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little) See Also: org.apache.poi.hssf.model.Workbook See Also: org.apache.poi.hssf.usermodel.HSSFSheet version: 1.0-pre |
Constructor Summary | |
public | Sheet() |
Method Summary | |
public int | addMergedRegion(int rowFrom, short colFrom, int rowTo, short colTo) | public void | addRow(RowRecord row) Adds a row record to the sheet
This method is "loc" sensitive. | public void | addValueRecord(int row, CellValueRecordInterface col) Adds a value record to the sheet's contained binary records
(i.e. | public int | aggregateDrawingRecords(DrawingManager2 drawingManager) | public void | checkDimsLoc(Record rec, int recloc) | public Sheet | cloneSheet() Clones the low level records of this sheet and returns the new sheet instance.
This method is implemented by adding methods for deep cloning to all records that
can be added to a sheet. | protected Record | createBOF() | public BlankRecord | createBlank(int row, short col) | protected Record | createCalcCount() | protected Record | createCalcMode() | protected Record | createColInfo() | protected Record | createDefaultColWidth() | protected Record | createDefaultRowHeight() | protected Record | createDelta() | protected Record | createDimensions() | protected Record | createEOF() | protected Record | createFooter() | public FormulaRecord | createFormula(int row, short col, String formula) Attempts to parse the formula into PTGs and create a formula record
DOES NOT WORK YET
Parameters: row - - the row for the formula record Parameters: col - - the column of the formula record Parameters: formula - - a String representing the formula. | public void | createFreezePane(int colSplit, int rowSplit, int topRow, int leftmostColumn) Creates a split (freezepane). | protected Record | createGridset() | protected Record | createGuts() | protected Record | createHCenter() | protected Record | createHeader() | protected Record | createIndex() | protected Record | createIteration() | public LabelSSTRecord | createLabelSST(int row, short col, int index) | protected Record | createMergedCells() | public NumberRecord | createNumber(int row, short col, double value) | protected ObjectProtectRecord | createObjectProtect() creates an ObjectProtect record with protect set to false. | protected PasswordRecord | createPassword() creates a Password record with password set to 00. | protected Record | createPrintGridlines() creates the PrintGridlines record and sets it to false (that makes for ugly sheets). | protected Record | createPrintHeaders() | protected Record | createPrintSetup() | protected Record | createProtect() creates a Protect record with protect set to false. | protected Record | createRefMode() | public RowRecord | createRow(int row) Create a row record. | protected Record | createSaveRecalc() | protected ScenarioProtectRecord | createScenarioProtect() creates a ScenarioProtect record with protect set to false. | protected Record | createSelection() | public static Sheet | createSheet(List recs, int sheetnum, int offset) read support (offset used as starting point for search) for low level
API. | public static Sheet | createSheet(List records, int sheetnum) read support (offset = 0) Same as createSheet(Record[] recs, int, int)
only the record offset is assumed to be 0. | public static Sheet | createSheet() Creates a sheet with all the usual records minus values and the "index"
record (not required). | public void | createSplitPane(int xSplitPos, int ySplitPos, int topRow, int leftmostColumn, int activePane) Creates a split pane. | protected Record | createVCenter() | protected Record | createWSBool() | protected WindowTwoRecord | createWindowTwo() | public Record | findFirstRecordBySid(short sid) Returns the first occurance of a record matching a particular sid. | public int | findFirstRecordLocBySid(short sid) Finds the first occurance of a record matching a particular sid and
returns it's position. | public short | getActiveCellCol() | public int | getActiveCellRow() | public Iterator | getColumnBreaks() | public short | getColumnWidth(short column) | public short | getDefaultColumnWidth() | public short | getDefaultRowHeight() | public int | getDimsLoc() | public int | getEofLoc() | public FooterRecord | getFooter() Returns the FooterRecord. | public GridsetRecord | getGridsetRecord() Gets the gridset record for this sheet. | public HeaderRecord | getHeader() Returns the HeaderRecord. | public short | getLeftCol() | public int | getLoc() | public double | getMargin(short margin) Gets the size of the margin in inches. | protected Margin[] | getMargins() Returns the array of margins. | public MergeCellsRecord.MergedRegion | getMergedRegionAt(int index) | public RowRecord | getNextRow() get the NEXT RowRecord (from LOC). | public CellValueRecordInterface | getNextValueRecord() get the NEXT value record (from LOC). | public int | getNumColumnBreaks() | public int | getNumMergedRegions() | public int | getNumRecords() Returns the number of low level binary records in this sheet. | public int | getNumRowBreaks() | public PaneInformation | getPaneInformation() Returns the information regarding the currently configured pane (split or freeze). | public PasswordRecord | getPassword() Returns the PasswordRecord. | public int | getPreOffset() get the preoffset when using DBCELL records (currently unused) - this is
the position of this sheet within the whole file. | public PrintGridlinesRecord | getPrintGridlines() Returns the PrintGridlinesRecord. | public PrintSetupRecord | getPrintSetup() Returns the PrintSetupRecord. | public ProtectRecord | getProtect() Returns the ProtectRecord. | public List | getRecords() | public RowRecord | getRow(int rownum) get the NEXT (from LOC) RowRecord where rownumber matches the given rownum.
The first record that is a Row record (starting at LOC) that has the
same rownum as the given rownum will be returned.
This method is "loc" sensitive. | public Iterator | getRowBreaks() | public SelectionRecord | getSelection() | public int | getSize() | public short | getTopRow() | public short | getXFIndexForColAt(short column) get the index to the ExtendedFormatRecord "associated" with
the column at specified 0-based index. | public void | groupColumnRange(short fromColumn, short toColumn, boolean indent) Creates an outline group for the specified columns. | public void | groupRowRange(int fromRow, int toRow, boolean indent) | public boolean | isColumnBroken(short column) | public boolean | isColumnHidden(short column) Get the hidden property for a given column. | public boolean | isDisplayFormulas() Returns if formulas are displayed. | public boolean | isDisplayGridlines() Returns if gridlines are displayed. | public boolean | isDisplayRowColHeadings() Returns if RowColHeadings are displayed. | public boolean | isGridsPrinted() get whether gridlines are printed. | public boolean[] | isProtected() | public boolean | isRowBroken(int row) | public void | preSerialize() Perform any work necessary before the sheet is about to be serialized. | public void | protectSheet(String password, boolean objects, boolean scenarios) protect a spreadsheet with a password (not encypted, just sets protect
flags and the password. | public void | removeColumnBreak(short column) | public void | removeMergedRegion(int index) | public void | removeRow(RowRecord row) Removes a row record
This method is not loc sensitive, it resets loc to = dimsloc so no worries. | public void | removeRowBreak(int row) | public void | removeValueRecord(int row, CellValueRecordInterface col) remove a value record from the records array. | public void | replaceValueRecord(CellValueRecordInterface newval) replace a value record from the records array.
This method is not loc sensitive, it resets loc to = dimsloc so no worries.
Parameters: newval - - a record supporting the CellValueRecordInterface. | public int | serialize(int offset, byte[] data) Serializes all records in the sheet into one big byte array. | public void | setActiveCellCol(short col) | public void | setActiveCellRow(int row) | public void | setColumn(short column, Short width, Integer level, Boolean hidden, Boolean collapsed) | public void | setColumn(short column, Short xfStyle, Short width, Integer level, Boolean hidden, Boolean collapsed) | public void | setColumnBreak(short column, short fromRow, short toRow) | public void | setColumnGroupCollapsed(short columnNumber, boolean collapsed) | public void | setColumnHidden(short column, boolean hidden) Get the hidden property for a given column. | public void | setColumnWidth(short column, short width) | public void | setDefaultColumnWidth(short dcw) | public void | setDefaultRowHeight(short dch) | public void | setDimensions(int firstrow, short firstcol, int lastrow, short lastcol) Per an earlier reported bug in working with Andy Khan's excel read library. | public void | setDisplayFormulas(boolean show) Sets whether the formulas are shown in a viewer. | public void | setDisplayGridlines(boolean show) /**
Sets whether the gridlines are shown in a viewer. | public void | setDisplayRowColHeadings(boolean show) Sets whether the RowColHeadings are shown in a viewer. | public void | setFooter(FooterRecord newFooter) Sets the FooterRecord. | public void | setGridsPrinted(boolean value) set whether gridlines printed or not. | public void | setHeader(HeaderRecord newHeader) Sets the HeaderRecord. | public void | setLeftCol(short leftCol) Sets the left column to show in desktop window pane. | public void | setLoc(int loc) set the locator for where we should look for the next value record. | public void | setMargin(short margin, double size) Sets the size of the margin in inches. | public void | setPreOffset(int offset) Set the preoffset when using DBCELL records (currently unused) - this is
the position of this sheet within the whole file. | public void | setPrintGridlines(PrintGridlinesRecord newPrintGridlines) Sets the PrintGridlinesRecord. | public void | setPrintSetup(PrintSetupRecord newPrintSetup) Sets the PrintSetupRecord. | public void | setRowBreak(int row, short fromCol, short toCol) | public void | setRowGroupCollapsed(int row, boolean collapse) | public void | setSCLRecord(SCLRecord sclRecord) Sets the SCL record or creates it in the correct place if it does not
already exist. | public void | setSelected(boolean sel) | public void | setSelection(SelectionRecord selection) | public void | setTopRow(short topRow) | public void | shiftBreaks(PageBreakRecord breaks, short start, short stop, int count) | public void | shiftColumnBreaks(short startingCol, short endingCol, short count) | public void | shiftRowBreaks(int startingRow, int endingRow, int count) | public void | unprotectSheet(boolean sheet, boolean objects, boolean scenarios) unprotect objects in the sheet (will not protect them, but any set to false are
unprotected. |
BottomMargin | final public static short BottomMargin(Code) | | |
LeftMargin | final public static short LeftMargin(Code) | | |
PANE_LOWER_LEFT | final public static byte PANE_LOWER_LEFT(Code) | | |
PANE_LOWER_RIGHT | final public static byte PANE_LOWER_RIGHT(Code) | | |
PANE_UPPER_LEFT | final public static byte PANE_UPPER_LEFT(Code) | | |
PANE_UPPER_RIGHT | final public static byte PANE_UPPER_RIGHT(Code) | | |
RightMargin | final public static short RightMargin(Code) | | |
TopMargin | final public static short TopMargin(Code) | | |
dimsloc | protected int dimsloc(Code) | | |
eofLoc | protected int eofLoc(Code) | | |
numMergedRegions | protected int numMergedRegions(Code) | | |
addMergedRegion | public int addMergedRegion(int rowFrom, short colFrom, int rowTo, short colTo)(Code) | | |
addRow | public void addRow(RowRecord row)(Code) | | Adds a row record to the sheet
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to.
Parameters: row - the row record to be added See Also: Sheet.setLoc(int) |
addValueRecord | public void addValueRecord(int row, CellValueRecordInterface col)(Code) | | Adds a value record to the sheet's contained binary records
(i.e. LabelSSTRecord or NumberRecord).
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to.
Parameters: row - the row to add the cell value to Parameters: col - the cell value record itself. |
checkDimsLoc | public void checkDimsLoc(Record rec, int recloc)(Code) | | in the event the record is a dimensions record, resets both the loc index and dimsloc index
|
cloneSheet | public Sheet cloneSheet()(Code) | | Clones the low level records of this sheet and returns the new sheet instance.
This method is implemented by adding methods for deep cloning to all records that
can be added to a sheet. The Record object does not implement cloneable.
When adding a new record, implement a public clone method if and only if the record
belongs to a sheet.
|
createBlank | public BlankRecord createBlank(int row, short col)(Code) | | create a BLANK record (does not add it to the records contained in this sheet)
Parameters: row - - the row the BlankRecord is a member of Parameters: col - - the column the BlankRecord is a member of |
createFormula | public FormulaRecord createFormula(int row, short col, String formula)(Code) | | Attempts to parse the formula into PTGs and create a formula record
DOES NOT WORK YET
Parameters: row - - the row for the formula record Parameters: col - - the column of the formula record Parameters: formula - - a String representing the formula. To be parsed to PTGs bogus/useless formula record |
createFreezePane | public void createFreezePane(int colSplit, int rowSplit, int topRow, int leftmostColumn)(Code) | | Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
Parameters: colSplit - Horizonatal position of split. Parameters: rowSplit - Vertical position of split. Parameters: topRow - Top row visible in bottom pane Parameters: leftmostColumn - Left column visible in right pane. |
createLabelSST | public LabelSSTRecord createLabelSST(int row, short col, int index)(Code) | | Create a LABELSST Record (does not add it to the records contained in this sheet)
Parameters: row - the row the LabelSST is a member of Parameters: col - the column the LabelSST defines Parameters: index - the index of the string within the SST (use workbook addSSTString method) LabelSSTRecord newly created containing your SST Index, row,col. See Also: org.apache.poi.hssf.record.SSTRecord |
createNumber | public NumberRecord createNumber(int row, short col, double value)(Code) | | Create a NUMBER Record (does not add it to the records contained in this sheet)
Parameters: row - the row the NumberRecord is a member of Parameters: col - the column the NumberRecord defines Parameters: value - for the number record NumberRecord for that row, col containing that value as added to the sheet |
createSheet | public static Sheet createSheet(List recs, int sheetnum, int offset)(Code) | | read support (offset used as starting point for search) for low level
API. Pass in an array of Record objects, the sheet number (0 based) and
a record offset (should be the location of the sheets BOF record). A Sheet
object is constructed and passed back with all of its initialization set
to the passed in records and references to those records held. This function
is normally called via Workbook.
Parameters: recs - array containing those records in the sheet in sequence (normally obtained from RecordFactory) Parameters: sheetnum - integer specifying the sheet's number (0,1 or 2 in this release) Parameters: offset - of the sheet's BOF record Sheet object with all values set to those read from the file See Also: org.apache.poi.hssf.model.Workbook See Also: org.apache.poi.hssf.record.Record |
createSheet | public static Sheet createSheet(List records, int sheetnum)(Code) | | read support (offset = 0) Same as createSheet(Record[] recs, int, int)
only the record offset is assumed to be 0.
Parameters: records - array containing those records in the sheet in sequence (normally obtained from RecordFactory) Parameters: sheetnum - integer specifying the sheet's number (0,1 or 2 in this release) Sheet object |
createSheet | public static Sheet createSheet()(Code) | | Creates a sheet with all the usual records minus values and the "index"
record (not required). Sets the location pointer to where the first value
records should go. Use this to create a sheet from "scratch".
Sheet object with all values set to defaults |
createSplitPane | public void createSplitPane(int xSplitPos, int ySplitPos, int topRow, int leftmostColumn, int activePane)(Code) | | Creates a split pane. Any existing freezepane or split pane is overwritten.
Parameters: xSplitPos - Horizonatal position of split (in 1/20th of a point). Parameters: ySplitPos - Vertical position of split (in 1/20th of a point). Parameters: topRow - Top row visible in bottom pane Parameters: leftmostColumn - Left column visible in right pane. Parameters: activePane - Active pane. One of: PANE_LOWER_RIGHT,PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT See Also: Sheet.PANE_LOWER_LEFT See Also: Sheet.PANE_LOWER_RIGHT See Also: Sheet.PANE_UPPER_LEFT See Also: Sheet.PANE_UPPER_RIGHT |
findFirstRecordBySid | public Record findFirstRecordBySid(short sid)(Code) | | Returns the first occurance of a record matching a particular sid.
|
findFirstRecordLocBySid | public int findFirstRecordLocBySid(short sid)(Code) | | Finds the first occurance of a record matching a particular sid and
returns it's position.
Parameters: sid - the sid to search for the record position of the matching record or -1 if no matchis made. |
getColumnBreaks | public Iterator getColumnBreaks()(Code) | | Returns all the column page breaks
all the column page breaks |
getDefaultColumnWidth | public short getDefaultColumnWidth()(Code) | | get the default column width for the sheet (if the columns do not define their own width)
default column width |
getDefaultRowHeight | public short getDefaultRowHeight()(Code) | | get the default row height for the sheet (if the rows do not define their own height)
default row height |
getDimsLoc | public int getDimsLoc()(Code) | | get the location of the DimensionsRecord (which is the last record before the value section)
location in the array of records of the DimensionsRecord |
getEofLoc | public int getEofLoc()(Code) | | |
getFooter | public FooterRecord getFooter()(Code) | | Returns the FooterRecord.
FooterRecord for the sheet. |
getGridsetRecord | public GridsetRecord getGridsetRecord()(Code) | | Gets the gridset record for this sheet.
|
getHeader | public HeaderRecord getHeader()(Code) | | Returns the HeaderRecord.
HeaderRecord for the sheet. |
getLeftCol | public short getLeftCol()(Code) | | |
getLoc | public int getLoc()(Code) | | Returns the location pointer to the first record to look for when adding rows/values
|
getMargin | public double getMargin(short margin)(Code) | | Gets the size of the margin in inches.
Parameters: margin - which margin to get the size of the margin |
getMargins | protected Margin[] getMargins()(Code) | | Returns the array of margins. If not created, will create.
the array of marings. |
getNextRow | public RowRecord getNextRow()(Code) | | get the NEXT RowRecord (from LOC). The first record that is a Row record
(starting at LOC) will be returned.
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to. For this method, set loc to dimsloc to start with.
subsequent calls will return rows in (physical) sequence or NULL when you get to the end.
RowRecord representing the next row record or NULL if there are no more See Also: Sheet.setLoc(int) |
getNextValueRecord | public CellValueRecordInterface getNextValueRecord()(Code) | | get the NEXT value record (from LOC). The first record that is a value record
(starting at LOC) will be returned.
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to. For this method, set loc to dimsloc to start with,
subsequent calls will return values in (physical) sequence or NULL when you get to the end.
CellValueRecordInterface representing the next value record or NULL if there are no more See Also: Sheet.setLoc(int) |
getNumColumnBreaks | public int getNumColumnBreaks()(Code) | | Returns the number of column page breaks
the number of column page breaks |
getNumMergedRegions | public int getNumMergedRegions()(Code) | | |
getNumRecords | public int getNumRecords()(Code) | | Returns the number of low level binary records in this sheet. This adjusts things for the so called
AgregateRecords.
See Also: org.apache.poi.hssf.record.Record |
getNumRowBreaks | public int getNumRowBreaks()(Code) | | Returns the number of row page breaks
the number of row page breaks |
getPaneInformation | public PaneInformation getPaneInformation()(Code) | | Returns the information regarding the currently configured pane (split or freeze).
null if no pane configured, or the pane information. |
getPassword | public PasswordRecord getPassword()(Code) | | Returns the PasswordRecord.
If one is not contained in the sheet, then one is created.
|
getPreOffset | public int getPreOffset()(Code) | | get the preoffset when using DBCELL records (currently unused) - this is
the position of this sheet within the whole file.
offset the offset of the sheet's BOF within the file. |
getPrintGridlines | public PrintGridlinesRecord getPrintGridlines()(Code) | | Returns the PrintGridlinesRecord.
PrintGridlinesRecord for the sheet. |
getPrintSetup | public PrintSetupRecord getPrintSetup()(Code) | | Returns the PrintSetupRecord.
PrintSetupRecord for the sheet. |
getProtect | public ProtectRecord getProtect()(Code) | | Returns the ProtectRecord.
If one is not contained in the sheet, then one is created.
|
getRow | public RowRecord getRow(int rownum)(Code) | | get the NEXT (from LOC) RowRecord where rownumber matches the given rownum.
The first record that is a Row record (starting at LOC) that has the
same rownum as the given rownum will be returned.
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to. For this method, set loc to dimsloc to start with.
subsequent calls will return rows in (physical) sequence or NULL when you get to the end.
Parameters: rownum - which row to return (careful with LOC) RowRecord representing the next row record or NULL if there are no more See Also: Sheet.setLoc(int) |
getRowBreaks | public Iterator getRowBreaks()(Code) | | Returns all the row page breaks
all the row page breaks |
getSize | public int getSize()(Code) | | |
getTopRow | public short getTopRow()(Code) | | |
getXFIndexForColAt | public short getXFIndexForColAt(short column)(Code) | | get the index to the ExtendedFormatRecord "associated" with
the column at specified 0-based index. (In this case, an
ExtendedFormatRecord index is actually associated with a
ColumnInfoRecord which spans 1 or more columns)
Returns the index to the default ExtendedFormatRecord (0xF)
if no ColumnInfoRecord exists that includes the column
index specified.
Parameters: column - index of ExtendedFormatRecord associated withColumnInfoRecord that includes the column index or theindex of the default ExtendedFormatRecord (0xF) |
groupColumnRange | public void groupColumnRange(short fromColumn, short toColumn, boolean indent)(Code) | | Creates an outline group for the specified columns.
Parameters: fromColumn - group from this column (inclusive) Parameters: toColumn - group to this column (inclusive) Parameters: indent - if true the group will be indented by one level,if false indenting will be removed by one level. |
groupRowRange | public void groupRowRange(int fromRow, int toRow, boolean indent)(Code) | | |
isColumnBroken | public boolean isColumnBroken(short column)(Code) | | Queries if the specified column has a page break
true if the specified column has a page break |
isDisplayFormulas | public boolean isDisplayFormulas()(Code) | | Returns if formulas are displayed.
whether formulas are displayed |
isDisplayGridlines | public boolean isDisplayGridlines()(Code) | | Returns if gridlines are displayed.
whether gridlines are displayed |
isDisplayRowColHeadings | public boolean isDisplayRowColHeadings()(Code) | | Returns if RowColHeadings are displayed.
whether RowColHeadings are displayed |
isGridsPrinted | public boolean isGridsPrinted()(Code) | | get whether gridlines are printed.
true if printed |
isProtected | public boolean[] isProtected()(Code) | | {sheet is protected, objects are proteced, scenarios are protected} |
isRowBroken | public boolean isRowBroken(int row)(Code) | | Queries if the specified row has a page break
Parameters: row - true if the specified row has a page break |
preSerialize | public void preSerialize()(Code) | | Perform any work necessary before the sheet is about to be serialized.
For instance the escher aggregates size needs to be calculated before
serialization so that the dgg record (which occurs first) can be written.
|
protectSheet | public void protectSheet(String password, boolean objects, boolean scenarios)(Code) | | protect a spreadsheet with a password (not encypted, just sets protect
flags and the password.
Parameters: password - to set Parameters: objects - are protected Parameters: scenarios - are protected |
removeColumnBreak | public void removeColumnBreak(short column)(Code) | | Removes a page break at the indicated column
|
removeMergedRegion | public void removeMergedRegion(int index)(Code) | | |
removeRow | public void removeRow(RowRecord row)(Code) | | Removes a row record
This method is not loc sensitive, it resets loc to = dimsloc so no worries.
Parameters: row - the row record to remove |
removeRowBreak | public void removeRowBreak(int row)(Code) | | Removes a page break at the indicated row
Parameters: row - |
removeValueRecord | public void removeValueRecord(int row, CellValueRecordInterface col)(Code) | | remove a value record from the records array.
This method is not loc sensitive, it resets loc to = dimsloc so no worries.
Parameters: row - - the row of the value record you wish to remove Parameters: col - - a record supporting the CellValueRecordInterface. See Also: org.apache.poi.hssf.record.CellValueRecordInterface |
replaceValueRecord | public void replaceValueRecord(CellValueRecordInterface newval)(Code) | | replace a value record from the records array.
This method is not loc sensitive, it resets loc to = dimsloc so no worries.
Parameters: newval - - a record supporting the CellValueRecordInterface. this will replacethe cell value with the same row and column. If there isn't one, one willbe added. |
serialize | public int serialize(int offset, byte[] data)(Code) | | Serializes all records in the sheet into one big byte array. Use this to write
the sheet out.
Parameters: offset - to begin write at Parameters: data - array containing the binary representation of the records in this sheet |
setColumnBreak | public void setColumnBreak(short column, short fromRow, short toRow)(Code) | | Sets a page break at the indicated column
|
setColumnGroupCollapsed | public void setColumnGroupCollapsed(short columnNumber, boolean collapsed)(Code) | | |
setColumnHidden | public void setColumnHidden(short column, boolean hidden)(Code) | | Get the hidden property for a given column.
Parameters: column - - the column number Parameters: hidden - - whether the column is hidden or not |
setColumnWidth | public void setColumnWidth(short column, short width)(Code) | | set the width for a given column in 1/20th of a character width units
Parameters: column - - the column number Parameters: width - (in units of 1/20th of a character width) |
setDefaultColumnWidth | public void setDefaultColumnWidth(short dcw)(Code) | | set the default column width for the sheet (if the columns do not define their own width)
Parameters: dcw - default column width |
setDefaultRowHeight | public void setDefaultRowHeight(short dch)(Code) | | set the default row height for the sheet (if the rows do not define their own height)
|
setDimensions | public void setDimensions(int firstrow, short firstcol, int lastrow, short lastcol)(Code) | | Per an earlier reported bug in working with Andy Khan's excel read library. This
sets the values in the sheet's DimensionsRecord object to be correct. Excel doesn't
really care, but we want to play nice with other libraries.
See Also: org.apache.poi.hssf.record.DimensionsRecord |
setDisplayFormulas | public void setDisplayFormulas(boolean show)(Code) | | Sets whether the formulas are shown in a viewer.
Parameters: show - whether to show formulas or not |
setDisplayGridlines | public void setDisplayGridlines(boolean show)(Code) | | /**
Sets whether the gridlines are shown in a viewer.
Parameters: show - whether to show gridlines or not |
setDisplayRowColHeadings | public void setDisplayRowColHeadings(boolean show)(Code) | | Sets whether the RowColHeadings are shown in a viewer.
Parameters: show - whether to show RowColHeadings or not |
setFooter | public void setFooter(FooterRecord newFooter)(Code) | | Sets the FooterRecord.
Parameters: newFooter - The new FooterRecord for the sheet. |
setGridsPrinted | public void setGridsPrinted(boolean value)(Code) | | set whether gridlines printed or not.
Parameters: value - True if gridlines printed. |
setHeader | public void setHeader(HeaderRecord newHeader)(Code) | | Sets the HeaderRecord.
Parameters: newHeader - The new HeaderRecord for the sheet. |
setLeftCol | public void setLeftCol(short leftCol)(Code) | | Sets the left column to show in desktop window pane.
Parameters: leftCol - the left column to show in desktop window pane |
setLoc | public void setLoc(int loc)(Code) | | set the locator for where we should look for the next value record. The
algorythm will actually start here and find the correct location so you
can set this to 0 and watch performance go down the tubes but it will work.
After a value is set this is automatically advanced. Its also set by the
create method. So you probably shouldn't mess with this unless you have
a compelling reason why or the help for the method you're calling says so.
Check the other methods for whether they care about
the loc pointer. Many of the "modify" and "remove" methods re-initialize this
to "dimsloc" which is the location of the Dimensions Record and presumably the
start of the value section (at or around 19 dec).
Parameters: loc - the record number to start at |
setMargin | public void setMargin(short margin, double size)(Code) | | Sets the size of the margin in inches.
Parameters: margin - which margin to get Parameters: size - the size of the margin |
setPreOffset | public void setPreOffset(int offset)(Code) | | Set the preoffset when using DBCELL records (currently unused) - this is
the position of this sheet within the whole file.
Parameters: offset - the offset of the sheet's BOF within the file. |
setPrintGridlines | public void setPrintGridlines(PrintGridlinesRecord newPrintGridlines)(Code) | | Sets the PrintGridlinesRecord.
Parameters: newPrintGridlines - The new PrintGridlinesRecord for the sheet. |
setPrintSetup | public void setPrintSetup(PrintSetupRecord newPrintSetup)(Code) | | Sets the PrintSetupRecord.
Parameters: newPrintSetup - The new PrintSetupRecord for the sheet. |
setRowBreak | public void setRowBreak(int row, short fromCol, short toCol)(Code) | | Sets a page break at the indicated row
Parameters: row - |
setRowGroupCollapsed | public void setRowGroupCollapsed(int row, boolean collapse)(Code) | | |
setSCLRecord | public void setSCLRecord(SCLRecord sclRecord)(Code) | | Sets the SCL record or creates it in the correct place if it does not
already exist.
Parameters: sclRecord - The record to set. |
setSelected | public void setSelected(boolean sel)(Code) | | Sets whether the sheet is selected
Parameters: sel - True to select the sheet, false otherwise. |
setTopRow | public void setTopRow(short topRow)(Code) | | |
shiftBreaks | public void shiftBreaks(PageBreakRecord breaks, short start, short stop, int count)(Code) | | Shifts all the page breaks in the range "count" number of rows/columns
Parameters: breaks - The page record to be shifted Parameters: start - Starting "main" value to shift breaks Parameters: stop - Ending "main" value to shift breaks Parameters: count - number of units (rows/columns) to shift by |
shiftColumnBreaks | public void shiftColumnBreaks(short startingCol, short endingCol, short count)(Code) | | Shifts the vertical page breaks for the indicated count
Parameters: startingCol - Parameters: endingCol - Parameters: count - |
shiftRowBreaks | public void shiftRowBreaks(int startingRow, int endingRow, int count)(Code) | | Shifts the horizontal page breaks for the indicated count
Parameters: startingRow - Parameters: endingRow - Parameters: count - |
unprotectSheet | public void unprotectSheet(boolean sheet, boolean objects, boolean scenarios)(Code) | | unprotect objects in the sheet (will not protect them, but any set to false are
unprotected.
Parameters: sheet - is unprotected (false = unprotect) Parameters: objects - are unprotected (false = unprotect) Parameters: scenarios - are unprotected (false = unprotect) |
|
|