This file contains the low level binary records starting at the workbook's BOF and ending with the workbook's EOF. Use HSSFWorkbook 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 https://sc.openoffice.org/excelfileformat.pdf before even attempting to use this.
HSSFWorkbook
| Modifier and Type | Field and Description |
|---|---|
| public static final String | BOOK
Crystal exports may use this for a regular .xls file. |
| private final List | boundsheets
holds the "boundsheet" records (aka bundlesheet) so that they can have their reference to their "BOF" marker |
| private static final short | CODEPAGE
constant used to set the "codepage" wherever "codepage" is set in records (which is duplicated in more than one record) |
| private final Map | commentRecords
Hold the |
| private DrawingManager2 | |
| private final List | |
| private FileSharingRecord | |
| private final List | |
| private final List | |
| private LinkTable | |
| private static final Logger | |
| private static final int | MAX_SENSITIVE_SHEET_NAME_LEN
Excel silently truncates long sheet names to 31 chars. |
| private int | maxformatid
holds the max format id |
| private int | numfonts
the number of font records |
| private int | numxfs
the number of extended format records |
| public static final String | OLD_WORKBOOK_DIR_ENTRY_NAME
Name of older (pre-Excel 97) Workbook streams, which
aren't supported by HSSFWorkbook, only by
|
| private final WorkbookRecordList | records
this contains the Worksheet record objects |
| protected SSTRecord | sst
this contains a reference to the SSTRecord so that new stings can be added to it. |
| private boolean | uses1904datewindowing
whether 1904 date windowing is being used |
| private WindowOneRecord | |
| public static final String | |
| public static final List | WORKBOOK_DIR_ENTRY_NAMES
Normally, the Workbook will be in a POIFS Stream called "Workbook". |
| public static final List | |
| private WriteAccessRecord | |
| private WriteProtectRecord |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public NameRecord | |
| public int | Returns: index of the string within the SSTRecordthe string to be added to the SSTRecord string)Adds a string to the SST table and returns its index (if its a duplicate just returns its index and update the counts) ASSUMES compressed unicode (meaning 8bit) |
| public boolean | Returns: true if the oldUrl was found and replaced with newUrl. Otherwise falseThe old URL to search for and which is to be replaced oldUrl, String The URL replacement newUrl)Changes an external referenced file to another file. |
| public short | Returns: index to extern sheetlocal sheet number sheetNumber)Returns the extern sheet number for specific sheet number. |
| public short | Returns: index to extern sheetfirst local sheet number firstSheetNumber, int last local sheet number lastSheetNumber)Returns the extern sheet number for specific range of sheets. |
| private void | checkSheets(int sheetnum)
if we're trying to address one more sheet than we have, go ahead and add it! |
| public void | |
| public NameRecord | |
| private static BackupRecord | |
| private static BOFRecord | |
| private static BookBoolRecord | |
| private static BoundSheetRecord | Returns: record containing a BoundSheetRecordeither sheet 0,1 or 2. id)create a "bound sheet" or "bundlesheet" (depending who you ask) record Always sets the sheet's bof to 0. |
| public NameRecord | Returns: a new NameRecordthe built-in name builtInName, int the sheet number sheetNumber)Generates a NameRecord to represent a built-in region |
| public ExtendedFormatRecord | Returns: ExtendedFormatRecord that was createdcreates a new Cell-type Extended Format Record and adds it to the end of ExtendedFormatRecords collection |
| private static CodepageRecord | |
| private static CountryRecord | createCountry()
Creates the Country record with the default country set to 1 and current country set to 7 in case of russian locale ("ru_RU") and 1 otherwise |
| private static DateWindow1904Record | |
| public void | |
| private static DSFRecord | |
| private static ExtendedFormatRecord | createExtendedFormat(int
the number of the extended format record to create (meaning its position in
a file as MS Excel would create it.) id)Creates an ExtendedFormatRecord object |
| private static ExtendedFormatRecord | |
| private static ExtendedFormatRecord | Returns: ExtendedFormatRecord with initial defaults (cell-type)creates an default cell type ExtendedFormatRecord object. |
| private static ExtSSTRecord | |
| private static FnGroupCountRecord | |
| private static FontRecord | createFont()
creates a Font record with the following magic values: fontheight = 0xc8 attributes = 0x0 color palette index = 0x7fff bold weight = 0x190 Font Name Length = 5 Font Name = Arial
|
| private static FormatRecord | createFormat(int
the number of the format record to create (meaning its position in
a file as M$ Excel would create it.) id)Creates a FormatRecord object |
| public int | Returns: the index code of the format record.the format string formatString)Creates a FormatRecord, inserts it, and returns the index code. |
| private static HideObjRecord | |
| private static MMSRecord | |
| public NameRecord | |
| public FontRecord | Returns: FontRecord that was just createdcreates a new font record and adds it to the "font table". |
| private static PaletteRecord | |
| private static PasswordRecord | |
| private static PasswordRev4Record | |
| private static PrecisionRecord | |
| private static ProtectRecord | |
| private static ProtectionRev4Record | |
| private static RefreshAllRecord | Returns: a new RefreshAll record with refreshAll set to false. (do not refresh all calcs)
|
| private static StyleRecord | createStyle(int
the number of the style record to create (meaning its position in
a file as MS Excel would create it. id)Creates a StyleRecord object |
| public StyleRecord | Returns: a new StyleRecordthe extended format index xfIndex)Creates a new StyleRecord, for the given Extended Format index, and adds it onto the end of the records collection |
| private static TabIdRecord | |
| private static UseSelFSRecord | |
| private static WindowOneRecord | createWindowOne()
creates the WindowOne record with the following magic values: horizontal hold - 0x168 vertical hold - 0x10e width - 0x3a5c height - 0x23be options - 0x38 selected tab - 0 displayed tab - 0 num selected tab- 0 tab width ratio - 0x258
|
| private static WindowProtectRecord | |
| public static InternalWorkbook | Returns: Workbook objectan array of Record objects recs)read support for low level API. |
| public static InternalWorkbook | Returns: an empty workbook objectCreates an empty workbook object with three blank sheets and all the empty fields. |
| private static WriteAccessRecord | |
| public boolean | Returns: true if the sheet contains the name, false otherwise.the name to test (case insensitive match) name, int the sheet to exclude from the check or -1 to include all sheets in the check. excludeSheetIdx)Determines whether a workbook contains the provided sheet name. |
| public DrawingManager2 | Returns: the primary drawing groupFinds the primary drawing group, if one already exists |
| private static DrawingManager2 | |
| public Record | Returns: the matching record ornull if it wasn't foundthe sid sid)Returns the first occurance of a record matching a particular sid. |
| public int | Returns: The index of -1 if no match made.The sid of the record to match sid)Returns the index of a record matching a particular sid. |
| public Record | Returns: the matching record ornull if it wasn't foundthe sid sid, int specifies the n-th matching sid pos)Returns the next occurance of a record matching a particular sid. |
| public String | Returns: first sheet name.extern sheet index externSheetIndex)Finds the first sheet name by his extern sheet index |
| public String | |
| private String | |
| private void | |
| public BackupRecord | Returns: the position of the backup recordReturns the position of the backup record. |
| private BoundSheetRecord | |
| public EscherBSERecord | |
| public PaletteRecord | Returns: the custom paletteReturns the custom palette in use for this workbook; if a custom palette record does not exist, then it is created. |
| public DrawingManager2 | |
| public ExtendedFormatRecord | Returns: ExtendedFormatRecord at the given indexof the Extended format record (0-based) index)gets the ExtendedFormatRecord at the given 0-based index |
| public EvaluationWorkbook. | |
| public EvaluationWorkbook. | |
| public int | |
| public int | |
| public FileSharingRecord | |
| public int | Returns: The index to the sheet found.The external sheet number to convert externSheetNumber)Finds the (first) sheet index for a particular external sheet number. |
| public int | |
| public FontRecord | Returns: FontRecord located at the given indexthe index to look at (0 or greater but NOT 4) idx)gets the font record at the given index in the font table. |
| public short | |
| public List | Returns: ArrayList of FormatRecords in the notebookReturns the list of FormatRecords in the workbook. |
| public List | |
| public int | Returns: The index to the sheet found.The external sheet number to convert externSheetNumber)Finds the last sheet index for a particular external sheet number, which may be the same as the first (except for multi-sheet references) |
| public NameCommentRecord | Returns: name comment record ornull if there isn't one for the given name.name record who's comment is required. nameRecord)gets the name comment record |
| public NameRecord | |
| public NameXPtg | Returns: the external name or nullthe name of an external function, typically a name of a UDF name, int the sheet ref index, or -1 if not known sheetRefIndex, UDFFinder locator of user-defined functions to resolve names of VBA and Add-In functions udf)
|
| public NameXPtg | |
| public int | Returns: number of font records in the "font table"gets the number of font records |
| public int | Returns: int count of ExtendedFormat recordsget the number of ExtendedFormat records contained in this workbook. |
| public int | |
| public int | |
| public int | Returns: number of BoundSheet recordsreturns the number of boundsheet objects contained in this workbook. |
| private LinkTable | getOrCreateLinkTable()
lazy initialization Note - creating the link table causes creation of 1 EXTERNALBOOK and 1 EXTERNALSHEET record |
| public RecalcIdRecord | |
| public List | |
| public int | Returns: sheet index or -1 if it was not found.sheet name name)get the sheet's index |
| public String | Returns: sheetname the name for the sheetthe sheet number (0 based) sheetIndex)gets the name for a given sheet. |
| public SheetVisibility | Returns: True if sheet is hiddenthe sheet number (0 based) sheetnum)Gets the hidden flag for a given sheet. |
| public int | |
| public NameRecord | Returns: null if no builtin NameRecord matchesbyte representation of the builtin name to match name, int 1-based sheet number sheetNumber)Retrieves the Builtin NameRecord that matches the name and index There shouldn't be too many names to make the sequential search too slow |
| public UnicodeString | Returns: String containing the SST Stringthe index into the SST table str)given an index into the SST table, this function returns the corresponding String value |
| public StyleRecord | Returns: the StyleRecord,null if it that ExtendedFormat doesn't have a Style set.the extended format index xfIndex)Returns the StyleRecord for the given xfIndex, or null if that ExtendedFormat doesn't have a Style set. |
| public WindowOneRecord | |
| public WorkbookRecordList | Returns: The list of records.Only for internal calls - code based on this is not supported ... |
| public WriteAccessRecord | |
| public WriteProtectRecord | |
| public void | insertSST()
use this function to add a Shared String Table to an existing sheet (say generated by a different java api) without an sst.... |
| public boolean | Returns: True if sheet is hiddenthe sheet number (0 based) sheetnum)Gets the hidden flag for a given sheet. |
| public boolean | Returns: True if sheet is very hiddenthe sheet number (0 based) sheetnum)Gets the very hidden flag for a given sheet. |
| public boolean | Returns: true if using 1904 date windowingWhether date windowing is based on 1/2/1904 or 1/1/1900. |
| public boolean | Returns: true if the workbook is write protectedis the workbook protected with a password (not encrypted)? |
| public int | |
| public void | |
| public void | removeBuiltinRecord(byte
byte representation of the builtin to match name, int zero-based sheet reference sheetIndex)Removes the specified Builtin NameRecord that matches the name and index |
| public void | removeExFormatRecord(ExtendedFormatRecord
the ExtendedFormatRecord rec)Removes the given ExtendedFormatRecord record from the file's list. |
| public void | removeExFormatRecord(int
of the Extended format record (0-based) index)Removes ExtendedFormatRecord record with given index from the file's list. |
| public void | |
| public void | |
| public void | |
| public String | Returns: the string representation of the defined or external nameIndex to REF entry in EXTERNSHEET record in the Link Table refIndex, int zero-based to DEFINEDNAME or EXTERNALNAME record definedNameIndex)
|
| public int | Returns: the length of serialized bytesof the data to be written offset, byte[] array of bytes to write this to data)Serializes all records int the worksheet section into a big byte array. |
| public void | setSheetBof(int
the number of the sheet to set the positing of the bof for sheetIndex, int the actual bof position pos)Sets the BOF for a given sheet |
| public void | setSheetHidden(int
The sheet number sheetnum, boolean True to mark the sheet as hidden, false otherwise hidden)Hide or unhide a sheet |
| public void | setSheetHidden(int
The sheet number sheetnum, SheetVisibility the sheet visibility to set (visible, hidden, very hidden) visibility)Hide or unhide a sheet. |
| public void | setSheetName(int
the sheet number (0 based) sheetnum, final String the name for the sheet sheetname)sets the name for a given sheet. |
| public void | setSheetOrder(String
the name of the sheet to reorder sheetname, int the position that we want to insert the sheet into (0 based) pos)sets the order of appearance for a given sheet. |
| public void | |
| public void | updateNameCommentRecordCache(final NameCommentRecord
the comment record commentRecord)If a |
| public void | updateNamesAfterCellShift(FormulaShifter
the formula shifter shifter)Updates named ranges due to moving of cells |
| public void | updateStyleRecord(int
the extended format index that was previously associated with this StyleRecord oldXf, int the extended format index that is now associated with this StyleRecord newXf)Update the StyleRecord to point to the new given index. |
| public void | writeProtectWorkbook(String
the password password, String the username username)protect a workbook with a password (not encrypted, just sets writeprotect flags and the password. |