Documentation

Xls extends BaseReader

Table of Contents

MS_BIFF_CRYPTO_NONE  = 0
MS_BIFF_CRYPTO_RC4  = 2
MS_BIFF_CRYPTO_XOR  = 1
REKEY_BLOCK  = 0x400
XLS_BIFF7  = 0x500
XLS_BIFF8  = 0x600
XLS_TYPE_ARRAY  = 0x221
XLS_TYPE_BLANK  = 0x201
XLS_TYPE_BOF  = 0x809
XLS_TYPE_BOOLERR  = 0x205
XLS_TYPE_BOTTOMMARGIN  = 0x29
XLS_TYPE_CFHEADER  = 0x1b0
XLS_TYPE_CFRULE  = 0x1b1
XLS_TYPE_CODEPAGE  = 0x42
XLS_TYPE_COLINFO  = 0x7d
XLS_TYPE_CONTINUE  = 0x3c
XLS_TYPE_DATAVALIDATION  = 0x1be
XLS_TYPE_DATAVALIDATIONS  = 0x1b2
XLS_TYPE_DATEMODE  = 0x22
XLS_TYPE_DBCELL  = 0xd7
XLS_TYPE_DEFAULTROWHEIGHT  = 0x225
XLS_TYPE_DEFCOLWIDTH  = 0x55
XLS_TYPE_DEFINEDNAME  = 0x18
XLS_TYPE_DIMENSION  = 0x200
XLS_TYPE_EOF  = 0xa
XLS_TYPE_EXTERNALBOOK  = 0x1ae
XLS_TYPE_EXTERNNAME  = 0x23
XLS_TYPE_EXTERNSHEET  = 0x17
XLS_TYPE_EXTSST  = 0xff
XLS_TYPE_FILEPASS  = 0x2f
XLS_TYPE_FONT  = 0x31
XLS_TYPE_FOOTER  = 0x15
XLS_TYPE_FORMAT  = 0x41e
XLS_TYPE_FORMULA  = 0x6
XLS_TYPE_HCENTER  = 0x83
XLS_TYPE_HEADER  = 0x14
XLS_TYPE_HORIZONTALPAGEBREAKS  = 0x1b
XLS_TYPE_HYPERLINK  = 0x1b8
XLS_TYPE_IMDATA  = 0x7f
XLS_TYPE_INDEX  = 0x20b
XLS_TYPE_LABEL  = 0x204
XLS_TYPE_LABELSST  = 0xfd
XLS_TYPE_LEFTMARGIN  = 0x26
XLS_TYPE_MERGEDCELLS  = 0xe5
XLS_TYPE_MSODRAWING  = 0xec
XLS_TYPE_MSODRAWINGGROUP  = 0xeb
XLS_TYPE_MULBLANK  = 0xbe
XLS_TYPE_MULRK  = 0xbd
XLS_TYPE_NOTE  = 0x1c
XLS_TYPE_NUMBER  = 0x203
XLS_TYPE_OBJ  = 0x5d
XLS_TYPE_OBJECTPROTECT  = 0x63
XLS_TYPE_PAGELAYOUTVIEW  = 0x88b
XLS_TYPE_PAGESETUP  = 0xa1
XLS_TYPE_PALETTE  = 0x92
XLS_TYPE_PANE  = 0x41
XLS_TYPE_PASSWORD  = 0x13
XLS_TYPE_PRINTGRIDLINES  = 0x2b
XLS_TYPE_PROTECT  = 0x12
XLS_TYPE_RANGEPROTECTION  = 0x868
XLS_TYPE_RIGHTMARGIN  = 0x27
XLS_TYPE_RK  = 0x27e
XLS_TYPE_ROW  = 0x208
XLS_TYPE_SCENPROTECT  = 0xdd
XLS_TYPE_SCL  = 0xa0
XLS_TYPE_SELECTION  = 0x1d
XLS_TYPE_SHAREDFMLA  = 0x4bc
XLS_TYPE_SHEET  = 0x85
XLS_TYPE_SHEETLAYOUT  = 0x862
XLS_TYPE_SHEETPR  = 0x81
XLS_TYPE_SHEETPROTECTION  = 0x867
XLS_TYPE_SST  = 0xfc
XLS_TYPE_STRING  = 0x207
XLS_TYPE_STYLE  = 0x293
XLS_TYPE_TOPMARGIN  = 0x28
XLS_TYPE_TXO  = 0x1b6
XLS_TYPE_UNKNOWN  = 0xffff
XLS_TYPE_VCENTER  = 0x84
XLS_TYPE_VERTICALPAGEBREAKS  = 0x1a
XLS_TYPE_WINDOW2  = 0x23e
XLS_TYPE_XF  = 0xe0
XLS_TYPE_XFEXT  = 0x87d
XLS_WORKBOOKGLOBALS  = 0x5
XLS_WORKSHEET  = 0x10
$fileHandle  : mixed
$includeCharts  : bool
Read charts that are defined in the workbook? Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.
$loadSheetsOnly  : null|array<string|int, string>
Restrict which sheets should be loaded? This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.
$readDataOnly  : bool
Read data only? Identifies whether the Reader should only read data values for cells, and ignore any formatting information; or whether it should read both data and formatting.
$readEmptyCells  : bool
Read empty cells? Identifies whether the Reader should read data values for cells all cells, or should ignore cells containing null value or empty string.
$readFilter  : IReadFilter
IReadFilter instance.
$securityScanner  : XmlScanner
$baseCell  : string
$cellNotes  : array<string|int, mixed>
Cell Annotations (BIFF8).
$codepage  : string
Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95) For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE'.
$data  : string
Workbook stream data. (Includes workbook globals substream as well as sheet substreams).
$dataSize  : int
Size in bytes of $this->data.
$definedname  : array<string|int, mixed>
Defined names.
$documentSummaryInformation  : string
Extended Summary Information stream data.
$drawingData  : string
The combined MSODRAWING data (per sheet).
$drawingGroupData  : string
The combined MSODRAWINGGROUP data.
$encryption  : int
The type of encryption in use.
$encryptionStartPos  : int
The position in the stream after which contents are encrypted.
$externalBooks  : array<string|int, mixed>
External books.
$externalNames  : array<string|int, mixed>
External names.
$formats  : array<string|int, mixed>
Shared formats.
$frozen  : bool
Panes are frozen? (in sheet currently being read). See WINDOW2 record.
$isFitToPages  : bool
Fit printout to number of pages? (in sheet currently being read). See SHEETPR record.
$mapCellStyleXfIndex  : array<string|int, mixed>
Mapping of XF index (that is a style XF) to final index in cellStyleXf collection.
$mapCellXfIndex  : array<string|int, mixed>
Mapping of XF index (that is a cell XF) to final index in cellXf collection.
$md5Ctxt  : string
The current MD5 context state.
$objFonts  : array<string|int, Font>
Shared fonts.
$objs  : array<string|int, mixed>
Objects. One OBJ record contributes with one entry.
$palette  : array<string|int, mixed>
Color palette.
$phpSheet  : Worksheet
Worksheet that is currently being built by the reader.
$pos  : int
Current position in stream.
$rc4Key  : RC4
The current RC4 decryption object.
$rc4Pos  : int
The position in the stream that the RC4 decryption object was left at.
$ref  : array<string|int, mixed>
REF structures. Only applies to BIFF8.
$sharedFormulaParts  : array<string|int, mixed>
The shared formula parts in a sheet. One FORMULA record contributes with one value if it refers to a shared formula.
$sharedFormulas  : array<string|int, mixed>
The shared formulas in a sheet. One SHAREDFMLA record contributes with one value.
$sheets  : array<string|int, mixed>
Worksheets.
$spreadsheet  : Spreadsheet
Workbook to be returned by the reader.
$sst  : array<string|int, mixed>
Shared strings. Only applies to BIFF8.
$summaryInformation  : string
Summary Information stream data.
$textObjects  : array<string|int, mixed>
Text Objects. One TXO record corresponds with one entry.
$textObjRef  : int
$version  : int
BIFF version.
$xfIndex  : int
Keep track of XF index.
__construct()  : mixed
Create a new Xls Reader instance.
canRead()  : bool
Can the current IReader read the file?
getIncludeCharts()  : bool
Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.
getInt2d()  : int
Read 16-bit signed integer.
getInt4d()  : int
Read 32-bit signed integer.
getLoadSheetsOnly()  : mixed
Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.
getMapCellStyleXfIndex()  : array<string|int, mixed>
Phpstan 1.4.4 complains that this property is never read.
getReadDataOnly()  : bool
Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.
getReadEmptyCells()  : bool
Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
getReadFilter()  : IReadFilter
Read filter.
getSecurityScanner()  : mixed
getUInt2d()  : int
Read 16-bit unsigned integer.
listWorksheetInfo()  : array<string|int, mixed>
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
listWorksheetNames()  : array<string|int, mixed>
Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.
load()  : Spreadsheet
Loads Spreadsheet from file.
setCodepage()  : void
setIncludeCharts()  : IReader
Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.
setLoadAllSheets()  : IReader
Set all sheets to load Tells the Reader to load all worksheets from the workbook.
setLoadSheetsOnly()  : IReader
Set which sheets to load.
setReadDataOnly()  : IReader
Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
setReadEmptyCells()  : IReader
Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
setReadFilter()  : IReader
Set read filter.
loadSpreadsheetFromFile()  : Spreadsheet
Loads PhpSpreadsheet from file.
openFile()  : void
Open file for reading.
processFlags()  : void
createFormulaFromTokens()  : string
Take array of tokens together with additional data for formula and return human readable formula.
decodeCodepage()  : string
Convert string to UTF-8. Only used for BIFF5.
encodeUTF16()  : string
Get UTF-8 string from (compressed or uncompressed) UTF-16 string.
extractNumber()  : float
Reads first 8 bytes of a string and return IEEE 754 float.
getCFAlignmentStyle()  : void
getCFBorderStyle()  : void
getCFFillStyle()  : void
getCFFontStyle()  : void
getCFProtectionStyle()  : void
getCFStyleOptions()  : void
getFormulaFromData()  : string
Take formula data and additional data for formula and return human readable formula.
getFormulaFromStructure()  : string
Convert formula structure into human readable Excel formula like 'A3+A5*5'.
getIEEE754()  : float
getNextToken()  : array<string|int, mixed>
Fetch next token from binary formula data.
getSplicedRecordData()  : array<string|int, mixed>
Reads a record from current position in data stream and continues reading data as long as CONTINUE records are found. Splices the record data pieces and returns the combined string as if record data is in one piece.
includeCellRangeFiltered()  : mixed
loadOLE()  : void
Use OLE reader to extract the relevant data streams from the OLE file.
makeKey()  : RC4
Make an RC4 decryptor for the given block.
parseRichText()  : mixed
readBIFF5CellRangeAddressFixed()  : string
Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.
readBIFF5CellRangeAddressList()  : array<string|int, mixed>
Read BIFF5 cell range address list section 2.5.15.
readBIFF8CellAddress()  : string
Reads a cell address in BIFF8 e.g. 'A2' or '$A$2' section 3.3.4.
readBIFF8CellAddressB()  : string
Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.
readBIFF8CellRangeAddress()  : string
Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6' there are flags indicating whether column/row index is relative section 3.3.4.
readBIFF8CellRangeAddressB()  : string
Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.
readBIFF8CellRangeAddressFixed()  : string
Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.
readBIFF8CellRangeAddressList()  : array<string|int, mixed>
Read BIFF8 cell range address list section 2.5.15.
readBIFF8Constant()  : array<string|int, mixed>
read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' section 2.5.7 returns e.g. ['value' => '5', 'size' => 9].
readBIFF8ConstantArray()  : array<string|int, mixed>
read BIFF8 constant value array from array data returns e.g. ['value' => '{1,2;3,4}', 'size' => 40] section 2.5.8.
readBlank()  : void
Read BLANK record.
readBof()  : void
Read BOF.
readBoolErr()  : void
Read BOOLERR record This record represents a Boolean value or error value cell.
readBottomMargin()  : void
Read BOTTOMMARGIN record.
readByteStringLong()  : array<string|int, mixed>
Read byte string (16-bit string length) OpenOffice documentation: 2.5.2.
readByteStringShort()  : array<string|int, mixed>
Read byte string (8-bit string length) OpenOffice documentation: 2.5.2.
readCFFormula()  : null|float|int|string
readCFHeader()  : array<string|int, mixed>
readCFRule()  : void
readCodepage()  : void
CODEPAGE.
readColInfo()  : void
Read COLINFO record.
readContinue()  : void
Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented.
readDataValidation()  : void
Read DATAVALIDATION record.
readDataValidations()  : void
Read DATAVALIDATIONS record.
readDateMode()  : void
DATEMODE.
readDefault()  : void
Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record.
readDefaultRowHeight()  : void
Read DEFAULTROWHEIGHT record.
readDefColWidth()  : void
Read DEFCOLWIDTH record.
readDefinedName()  : void
DEFINEDNAME.
readDocumentSummaryInformation()  : void
Read additional document summary information.
readExternalBook()  : void
Read EXTERNALBOOK record.
readExternName()  : void
Read EXTERNNAME record.
readExternSheet()  : void
Read EXTERNSHEET record.
readFilepass()  : void
FILEPASS.
readFont()  : void
Read a FONT record.
readFooter()  : void
Read FOOTER record.
readFormat()  : void
FORMAT.
readFormula()  : void
Read FORMULA record + perhaps a following STRING record if formula result is a string This record contains the token array and the result of a formula cell.
readHcenter()  : void
Read HCENTER record.
readHeader()  : void
Read HEADER record.
readHorizontalPageBreaks()  : void
Read HORIZONTALPAGEBREAKS record.
readHyperLink()  : void
Read HYPERLINK record.
readLabel()  : void
Read LABEL record This record represents a cell that contains a string. In BIFF8 it is usually replaced by the LABELSST record.
readLabelSst()  : void
Read LABELSST record This record represents a cell that contains a string. It replaces the LABEL record and RSTRING record used in BIFF2-BIFF5.
readLeftMargin()  : void
Read LEFTMARGIN record.
readMergedCells()  : void
MERGEDCELLS.
readMsoDrawing()  : void
Read MSODRAWING record.
readMsoDrawingGroup()  : void
Read MSODRAWINGGROUP record.
readMulBlank()  : void
Read MULBLANK record This record represents a cell range of empty cells. All cells are located in the same row.
readMulRk()  : void
Read MULRK record This record represents a cell range containing RK value cells. All cells are located in the same row.
readNote()  : void
The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions, this record stores a note (cell note). This feature was significantly enhanced in Excel 97.
readNumber()  : void
Read NUMBER record This record represents a cell that contains a floating-point value.
readObj()  : void
Read OBJ record.
readObjectProtect()  : void
OBJECTPROTECT.
readPageLayoutView()  : void
Read PLV Record(Created by Excel2007 or upper).
readPageSetup()  : void
Read PAGESETUP record.
readPalette()  : void
Read PALETTE record.
readPane()  : void
Read PANE record.
readPassword()  : void
PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8).
readPrintGridlines()  : void
Read PRINTGRIDLINES record.
readProtect()  : void
PROTECT - Sheet protection (BIFF2 through BIFF8) if this record is omitted, then it also means no sheet protection.
readRangeProtection()  : void
Read RANGEPROTECTION record Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification, where it is referred to as FEAT record.
readRecordData()  : string
Read record data from stream, decrypting as required.
readRGB()  : array<string|int, mixed>
Extract RGB color OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4.
readRightMargin()  : void
Read RIGHTMARGIN record.
readRk()  : void
Read RK record This record represents a cell that contains an RK value (encoded integer or floating-point value). If a floating-point value cannot be encoded to an RK value, a NUMBER record will be written. This record replaces the record INTEGER written in BIFF2.
readRow()  : void
ROW.
readScenProtect()  : void
SCENPROTECT.
readScl()  : void
Read SCL record.
readSelection()  : void
Read SELECTION record. There is one such record for each pane in the sheet.
readSharedFmla()  : void
Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader, which usually contains relative references.
readSheet()  : void
SHEET.
readSheetLayout()  : void
Read SHEETLAYOUT record. Stores sheet tab color information.
readSheetPr()  : void
Read SHEETPR record.
readSheetProtection()  : void
Read SHEETPROTECTION record (FEATHEADR).
readSheetRangeByRefIndex()  : false|string
Get a sheet range like Sheet1:Sheet3 from REF index Note: If there is only one sheet in the range, one gets e.g Sheet1 It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets, in which case an Exception is thrown.
readSst()  : void
SST - Shared String Table.
readString()  : string
Read a STRING record from current stream position and advance the stream pointer to next record This record is used for storing result from FORMULA record when it is a string, and it occurs directly after the FORMULA record.
readStyle()  : void
Read STYLE record.
readSummaryInformation()  : void
Read summary information.
readTextObject()  : void
The TEXT Object record contains the text associated with a cell annotation.
readTopMargin()  : void
Read TOPMARGIN record.
readUnicodeString()  : array<string|int, mixed>
Read Unicode string with no string length field, but with known character count this function is under construction, needs to support rich text, and Asian phonetic settings OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3.
readUnicodeStringLong()  : array<string|int, mixed>
Extracts an Excel Unicode long string (16-bit string length) OpenOffice documentation: 2.5.3 this function is under construction, needs to support rich text, and Asian phonetic settings.
readUnicodeStringShort()  : array<string|int, mixed>
Extracts an Excel Unicode short string (8-bit string length) OpenOffice documentation: 2.5.3 function will automatically find out where the Unicode string ends.
readVcenter()  : void
Read VCENTER record.
readVerticalPageBreaks()  : void
Read VERTICALPAGEBREAKS record.
readWindow2()  : void
Read WINDOW2 record.
readXf()  : void
XF - Extended Format.
readXfExt()  : void
setCFRules()  : void
uncompressByteString()  : string
Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.
UTF8toExcelDoubleQuoted()  : string
Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.
verifyPassword()  : bool
Verify RC4 file password.

Constants

MS_BIFF_CRYPTO_NONE

public mixed MS_BIFF_CRYPTO_NONE = ""

MS_BIFF_CRYPTO_RC4

public mixed MS_BIFF_CRYPTO_RC4 = 2

MS_BIFF_CRYPTO_XOR

public mixed MS_BIFF_CRYPTO_XOR = 1

REKEY_BLOCK

public mixed REKEY_BLOCK = 0x400

XLS_BIFF7

public mixed XLS_BIFF7 = 0x500

XLS_BIFF8

public mixed XLS_BIFF8 = 0x600

XLS_TYPE_ARRAY

public mixed XLS_TYPE_ARRAY = 0x221

XLS_TYPE_BLANK

public mixed XLS_TYPE_BLANK = 0x201

XLS_TYPE_BOF

public mixed XLS_TYPE_BOF = 0x809

XLS_TYPE_BOOLERR

public mixed XLS_TYPE_BOOLERR = 0x205

XLS_TYPE_BOTTOMMARGIN

public mixed XLS_TYPE_BOTTOMMARGIN = 0x29

XLS_TYPE_CFHEADER

public mixed XLS_TYPE_CFHEADER = 0x1b0

XLS_TYPE_CFRULE

public mixed XLS_TYPE_CFRULE = 0x1b1

XLS_TYPE_CODEPAGE

public mixed XLS_TYPE_CODEPAGE = 0x42

XLS_TYPE_COLINFO

public mixed XLS_TYPE_COLINFO = 0x7d

XLS_TYPE_CONTINUE

public mixed XLS_TYPE_CONTINUE = 0x3c

XLS_TYPE_DATAVALIDATION

public mixed XLS_TYPE_DATAVALIDATION = 0x1be

XLS_TYPE_DATAVALIDATIONS

public mixed XLS_TYPE_DATAVALIDATIONS = 0x1b2

XLS_TYPE_DATEMODE

public mixed XLS_TYPE_DATEMODE = 0x22

XLS_TYPE_DBCELL

public mixed XLS_TYPE_DBCELL = 0xd7

XLS_TYPE_DEFAULTROWHEIGHT

public mixed XLS_TYPE_DEFAULTROWHEIGHT = 0x225

XLS_TYPE_DEFCOLWIDTH

public mixed XLS_TYPE_DEFCOLWIDTH = 0x55

XLS_TYPE_DEFINEDNAME

public mixed XLS_TYPE_DEFINEDNAME = 0x18

XLS_TYPE_DIMENSION

public mixed XLS_TYPE_DIMENSION = 0x200

XLS_TYPE_EOF

public mixed XLS_TYPE_EOF = 0xa

XLS_TYPE_EXTERNALBOOK

public mixed XLS_TYPE_EXTERNALBOOK = 0x1ae

XLS_TYPE_EXTERNNAME

public mixed XLS_TYPE_EXTERNNAME = 0x23

XLS_TYPE_EXTERNSHEET

public mixed XLS_TYPE_EXTERNSHEET = 0x17

XLS_TYPE_EXTSST

public mixed XLS_TYPE_EXTSST = 0xff

XLS_TYPE_FILEPASS

public mixed XLS_TYPE_FILEPASS = 0x2f

XLS_TYPE_FONT

public mixed XLS_TYPE_FONT = 0x31
public mixed XLS_TYPE_FOOTER = 0x15

XLS_TYPE_FORMAT

public mixed XLS_TYPE_FORMAT = 0x41e

XLS_TYPE_FORMULA

public mixed XLS_TYPE_FORMULA = 0x6

XLS_TYPE_HCENTER

public mixed XLS_TYPE_HCENTER = 0x83

XLS_TYPE_HEADER

public mixed XLS_TYPE_HEADER = 0x14

XLS_TYPE_HORIZONTALPAGEBREAKS

public mixed XLS_TYPE_HORIZONTALPAGEBREAKS = 0x1b
public mixed XLS_TYPE_HYPERLINK = 0x1b8

XLS_TYPE_IMDATA

public mixed XLS_TYPE_IMDATA = 0x7f

XLS_TYPE_INDEX

public mixed XLS_TYPE_INDEX = 0x20b

XLS_TYPE_LABEL

public mixed XLS_TYPE_LABEL = 0x204

XLS_TYPE_LABELSST

public mixed XLS_TYPE_LABELSST = 0xfd

XLS_TYPE_LEFTMARGIN

public mixed XLS_TYPE_LEFTMARGIN = 0x26

XLS_TYPE_MERGEDCELLS

public mixed XLS_TYPE_MERGEDCELLS = 0xe5

XLS_TYPE_MSODRAWING

public mixed XLS_TYPE_MSODRAWING = 0xec

XLS_TYPE_MSODRAWINGGROUP

public mixed XLS_TYPE_MSODRAWINGGROUP = 0xeb

XLS_TYPE_MULBLANK

public mixed XLS_TYPE_MULBLANK = 0xbe

XLS_TYPE_MULRK

public mixed XLS_TYPE_MULRK = 0xbd

XLS_TYPE_NOTE

public mixed XLS_TYPE_NOTE = 0x1c

XLS_TYPE_NUMBER

public mixed XLS_TYPE_NUMBER = 0x203

XLS_TYPE_OBJ

public mixed XLS_TYPE_OBJ = 0x5d

XLS_TYPE_OBJECTPROTECT

public mixed XLS_TYPE_OBJECTPROTECT = 0x63

XLS_TYPE_PAGELAYOUTVIEW

public mixed XLS_TYPE_PAGELAYOUTVIEW = 0x88b

XLS_TYPE_PAGESETUP

public mixed XLS_TYPE_PAGESETUP = 0xa1

XLS_TYPE_PALETTE

public mixed XLS_TYPE_PALETTE = 0x92

XLS_TYPE_PANE

public mixed XLS_TYPE_PANE = 0x41

XLS_TYPE_PASSWORD

public mixed XLS_TYPE_PASSWORD = 0x13

XLS_TYPE_PRINTGRIDLINES

public mixed XLS_TYPE_PRINTGRIDLINES = 0x2b

XLS_TYPE_PROTECT

public mixed XLS_TYPE_PROTECT = 0x12

XLS_TYPE_RANGEPROTECTION

public mixed XLS_TYPE_RANGEPROTECTION = 0x868

XLS_TYPE_RIGHTMARGIN

public mixed XLS_TYPE_RIGHTMARGIN = 0x27

XLS_TYPE_RK

public mixed XLS_TYPE_RK = 0x27e

XLS_TYPE_ROW

public mixed XLS_TYPE_ROW = 0x208

XLS_TYPE_SCENPROTECT

public mixed XLS_TYPE_SCENPROTECT = 0xdd

XLS_TYPE_SCL

public mixed XLS_TYPE_SCL = 0xa0

XLS_TYPE_SELECTION

public mixed XLS_TYPE_SELECTION = 0x1d

XLS_TYPE_SHAREDFMLA

public mixed XLS_TYPE_SHAREDFMLA = 0x4bc

XLS_TYPE_SHEET

public mixed XLS_TYPE_SHEET = 0x85

XLS_TYPE_SHEETLAYOUT

public mixed XLS_TYPE_SHEETLAYOUT = 0x862

XLS_TYPE_SHEETPR

public mixed XLS_TYPE_SHEETPR = 0x81

XLS_TYPE_SHEETPROTECTION

public mixed XLS_TYPE_SHEETPROTECTION = 0x867

XLS_TYPE_SST

public mixed XLS_TYPE_SST = 0xfc

XLS_TYPE_STRING

public mixed XLS_TYPE_STRING = 0x207

XLS_TYPE_STYLE

public mixed XLS_TYPE_STYLE = 0x293

XLS_TYPE_TOPMARGIN

public mixed XLS_TYPE_TOPMARGIN = 0x28

XLS_TYPE_TXO

public mixed XLS_TYPE_TXO = 0x1b6

XLS_TYPE_UNKNOWN

public mixed XLS_TYPE_UNKNOWN = 0xffff

XLS_TYPE_VCENTER

public mixed XLS_TYPE_VCENTER = 0x84

XLS_TYPE_VERTICALPAGEBREAKS

public mixed XLS_TYPE_VERTICALPAGEBREAKS = 0x1a

XLS_TYPE_WINDOW2

public mixed XLS_TYPE_WINDOW2 = 0x23e

XLS_TYPE_XF

public mixed XLS_TYPE_XF = 0xe0

XLS_TYPE_XFEXT

public mixed XLS_TYPE_XFEXT = 0x87d

XLS_WORKBOOKGLOBALS

public mixed XLS_WORKBOOKGLOBALS = 0x5

XLS_WORKSHEET

public mixed XLS_WORKSHEET = 0x10

Properties

$includeCharts

Read charts that are defined in the workbook? Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.

protected bool $includeCharts = false

$loadSheetsOnly

Restrict which sheets should be loaded? This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.

protected null|array<string|int, string> $loadSheetsOnly

$readDataOnly

Read data only? Identifies whether the Reader should only read data values for cells, and ignore any formatting information; or whether it should read both data and formatting.

protected bool $readDataOnly = false

$readEmptyCells

Read empty cells? Identifies whether the Reader should read data values for cells all cells, or should ignore cells containing null value or empty string.

protected bool $readEmptyCells = true

$baseCell

private string $baseCell

$cellNotes

Cell Annotations (BIFF8).

private array<string|int, mixed> $cellNotes

$codepage

Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95) For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE'.

private string $codepage

$data

Workbook stream data. (Includes workbook globals substream as well as sheet substreams).

private string $data

$dataSize

Size in bytes of $this->data.

private int $dataSize

$definedname

Defined names.

private array<string|int, mixed> $definedname

$documentSummaryInformation

Extended Summary Information stream data.

private string $documentSummaryInformation

$drawingData

The combined MSODRAWING data (per sheet).

private string $drawingData

$drawingGroupData

The combined MSODRAWINGGROUP data.

private string $drawingGroupData

$encryption

The type of encryption in use.

private int $encryption = 0

$encryptionStartPos

The position in the stream after which contents are encrypted.

private int $encryptionStartPos = 0

$externalBooks

External books.

private array<string|int, mixed> $externalBooks

$externalNames

External names.

private array<string|int, mixed> $externalNames

$formats

Shared formats.

private array<string|int, mixed> $formats

$frozen

Panes are frozen? (in sheet currently being read). See WINDOW2 record.

private bool $frozen

$isFitToPages

Fit printout to number of pages? (in sheet currently being read). See SHEETPR record.

private bool $isFitToPages

$mapCellStyleXfIndex

Mapping of XF index (that is a style XF) to final index in cellStyleXf collection.

private array<string|int, mixed> $mapCellStyleXfIndex

$mapCellXfIndex

Mapping of XF index (that is a cell XF) to final index in cellXf collection.

private array<string|int, mixed> $mapCellXfIndex

$md5Ctxt

The current MD5 context state.

private string $md5Ctxt

$objFonts

Shared fonts.

private array<string|int, Font> $objFonts

$objs

Objects. One OBJ record contributes with one entry.

private array<string|int, mixed> $objs

$palette

Color palette.

private array<string|int, mixed> $palette

$phpSheet

Worksheet that is currently being built by the reader.

private Worksheet $phpSheet

$pos

Current position in stream.

private int $pos

$rc4Key

The current RC4 decryption object.

private RC4 $rc4Key

$rc4Pos

The position in the stream that the RC4 decryption object was left at.

private int $rc4Pos = 0

$ref

REF structures. Only applies to BIFF8.

private array<string|int, mixed> $ref

$sharedFormulaParts

The shared formula parts in a sheet. One FORMULA record contributes with one value if it refers to a shared formula.

private array<string|int, mixed> $sharedFormulaParts

$sharedFormulas

The shared formulas in a sheet. One SHAREDFMLA record contributes with one value.

private array<string|int, mixed> $sharedFormulas

$sheets

Worksheets.

private array<string|int, mixed> $sheets

$spreadsheet

Workbook to be returned by the reader.

private Spreadsheet $spreadsheet

$sst

Shared strings. Only applies to BIFF8.

private array<string|int, mixed> $sst

$summaryInformation

Summary Information stream data.

private string $summaryInformation

$textObjects

Text Objects. One TXO record corresponds with one entry.

private array<string|int, mixed> $textObjects

$textObjRef

private int $textObjRef

$version

BIFF version.

private int $version

$xfIndex

Keep track of XF index.

private int $xfIndex

Methods

__construct()

Create a new Xls Reader instance.

public __construct() : mixed
Return values
mixed

canRead()

Can the current IReader read the file?

public canRead(string $filename) : bool
Parameters
$filename : string
Return values
bool

getIncludeCharts()

Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.

public getIncludeCharts() : bool

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. If false (the default) it will ignore any charts defined in the workbook file.

Return values
bool

getInt2d()

Read 16-bit signed integer.

public static getInt2d(string $data, int $pos) : int
Parameters
$data : string
$pos : int
Return values
int

getInt4d()

Read 32-bit signed integer.

public static getInt4d(string $data, int $pos) : int
Parameters
$data : string
$pos : int
Return values
int

getLoadSheetsOnly()

Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.

public getLoadSheetsOnly() : mixed
Return values
mixed

getMapCellStyleXfIndex()

Phpstan 1.4.4 complains that this property is never read.

public getMapCellStyleXfIndex() : array<string|int, mixed>

So, we might be able to get rid of it altogether. For now, however, this function makes it readable, which satisfies Phpstan.

Tags
codeCoverageIgnore
Return values
array<string|int, mixed>

getReadDataOnly()

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

public getReadDataOnly() : bool

If false (the default) it will read data and formatting.

Return values
bool

getReadEmptyCells()

Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.

public getReadEmptyCells() : bool

If false it will not read data for cells containing a null value or an empty string.

Return values
bool

getSecurityScanner()

public getSecurityScanner() : mixed
Return values
mixed

getUInt2d()

Read 16-bit unsigned integer.

public static getUInt2d(string $data, int $pos) : int
Parameters
$data : string
$pos : int
Return values
int

listWorksheetInfo()

Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).

public listWorksheetInfo(string $filename) : array<string|int, mixed>
Parameters
$filename : string
Return values
array<string|int, mixed>

listWorksheetNames()

Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.

public listWorksheetNames(string $filename) : array<string|int, mixed>
Parameters
$filename : string
Return values
array<string|int, mixed>

load()

Loads Spreadsheet from file.

public load(string $filename, int $flags) : Spreadsheet
Parameters
$filename : string
$flags : int

the optional second parameter flags may be used to identify specific elements that should be loaded, but which won't be loaded by default, using these values: IReader::LOAD_WITH_CHARTS - Include any charts that are defined in the loaded file

Return values
Spreadsheet

setCodepage()

public setCodepage(string $codepage) : void
Parameters
$codepage : string
Return values
void

setIncludeCharts()

Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.

public setIncludeCharts(mixed $includeCharts) : IReader

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. Set to false (the default) to discard charts.

Parameters
$includeCharts : mixed
Return values
IReader

setLoadAllSheets()

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

public setLoadAllSheets() : IReader
Return values
IReader

setLoadSheetsOnly()

Set which sheets to load.

public setLoadSheetsOnly(mixed $sheetList) : IReader
Parameters
$sheetList : mixed
Return values
IReader

setReadDataOnly()

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

public setReadDataOnly(mixed $readCellValuesOnly) : IReader

Set to false (the default) to advise the Reader to read both data and formatting for cells.

Parameters
$readCellValuesOnly : mixed
Return values
IReader

setReadEmptyCells()

Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.

public setReadEmptyCells(mixed $readEmptyCells) : IReader

Set to false to advise the Reader to ignore cells containing a null value or an empty string.

Parameters
$readEmptyCells : mixed
Return values
IReader

loadSpreadsheetFromFile()

Loads PhpSpreadsheet from file.

protected loadSpreadsheetFromFile(string $filename) : Spreadsheet
Parameters
$filename : string
Return values
Spreadsheet

openFile()

Open file for reading.

protected openFile(string $filename) : void
Parameters
$filename : string
Return values
void

processFlags()

protected processFlags(int $flags) : void
Parameters
$flags : int
Return values
void

createFormulaFromTokens()

Take array of tokens together with additional data for formula and return human readable formula.

private createFormulaFromTokens(array<string|int, mixed> $tokens, string $additionalData) : string
Parameters
$tokens : array<string|int, mixed>
$additionalData : string

Additional binary data going with the formula

Return values
string

Human readable formula

decodeCodepage()

Convert string to UTF-8. Only used for BIFF5.

private decodeCodepage(string $string) : string
Parameters
$string : string
Return values
string

encodeUTF16()

Get UTF-8 string from (compressed or uncompressed) UTF-16 string.

private static encodeUTF16(string $string[, bool $compressed = false ]) : string
Parameters
$string : string
$compressed : bool = false
Return values
string

extractNumber()

Reads first 8 bytes of a string and return IEEE 754 float.

private static extractNumber(string $data) : float
Parameters
$data : string

Binary string that is at least 8 bytes long

Return values
float

getCFAlignmentStyle()

private getCFAlignmentStyle(string $options, Style $style) : void
Parameters
$options : string
$style : Style
Return values
void

getCFBorderStyle()

private getCFBorderStyle(string $options, Style $style) : void
Parameters
$options : string
$style : Style
Return values
void

getCFFillStyle()

private getCFFillStyle(string $options, Style $style) : void
Parameters
$options : string
$style : Style
Return values
void

getCFFontStyle()

private getCFFontStyle(string $options, Style $style) : void
Parameters
$options : string
$style : Style
Return values
void

getCFProtectionStyle()

private getCFProtectionStyle(string $options, Style $style) : void
Parameters
$options : string
$style : Style
Return values
void

getCFStyleOptions()

private getCFStyleOptions(int $options, Style $style) : void
Parameters
$options : int
$style : Style
Return values
void

getFormulaFromData()

Take formula data and additional data for formula and return human readable formula.

private getFormulaFromData(string $formulaData[, string $additionalData = '' ][, string $baseCell = 'A1' ]) : string
Parameters
$formulaData : string

The binary data for the formula itself

$additionalData : string = ''

Additional binary data going with the formula

$baseCell : string = 'A1'

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Return values
string

Human readable formula

getFormulaFromStructure()

Convert formula structure into human readable Excel formula like 'A3+A5*5'.

private getFormulaFromStructure(string $formulaStructure[, string $baseCell = 'A1' ]) : string
Parameters
$formulaStructure : string

The complete binary data for the formula

$baseCell : string = 'A1'

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Return values
string

Human readable formula

getIEEE754()

private static getIEEE754(int $rknum) : float
Parameters
$rknum : int
Return values
float

getNextToken()

Fetch next token from binary formula data.

private getNextToken(string $formulaData[, string $baseCell = 'A1' ]) : array<string|int, mixed>
Parameters
$formulaData : string

Formula data

$baseCell : string = 'A1'

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Return values
array<string|int, mixed>

getSplicedRecordData()

Reads a record from current position in data stream and continues reading data as long as CONTINUE records are found. Splices the record data pieces and returns the combined string as if record data is in one piece.

private getSplicedRecordData() : array<string|int, mixed>

Moves to next current position in data stream to start of next record different from a CONtINUE record.

Return values
array<string|int, mixed>

includeCellRangeFiltered()

private includeCellRangeFiltered(mixed $cellRangeAddress) : mixed
Parameters
$cellRangeAddress : mixed
Return values
mixed

loadOLE()

Use OLE reader to extract the relevant data streams from the OLE file.

private loadOLE(string $filename) : void
Parameters
$filename : string
Return values
void

makeKey()

Make an RC4 decryptor for the given block.

private makeKey(int $block, string $valContext) : RC4
Parameters
$block : int

Block for which to create decrypto

$valContext : string

MD5 context state

Return values
RC4

parseRichText()

private parseRichText(mixed $is) : mixed
Parameters
$is : mixed
Return values
mixed

readBIFF5CellRangeAddressFixed()

Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.

private readBIFF5CellRangeAddressFixed(string $subData) : string
Parameters
$subData : string
Return values
string

readBIFF5CellRangeAddressList()

Read BIFF5 cell range address list section 2.5.15.

private readBIFF5CellRangeAddressList(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readBIFF8CellAddress()

Reads a cell address in BIFF8 e.g. 'A2' or '$A$2' section 3.3.4.

private readBIFF8CellAddress(string $cellAddressStructure) : string
Parameters
$cellAddressStructure : string
Return values
string

readBIFF8CellAddressB()

Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.

private readBIFF8CellAddressB(string $cellAddressStructure[, string $baseCell = 'A1' ]) : string
Parameters
$cellAddressStructure : string
$baseCell : string = 'A1'

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Return values
string

readBIFF8CellRangeAddress()

Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6' there are flags indicating whether column/row index is relative section 3.3.4.

private readBIFF8CellRangeAddress(string $subData) : string
Parameters
$subData : string
Return values
string

readBIFF8CellRangeAddressB()

Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.

private readBIFF8CellRangeAddressB(string $subData[, string $baseCell = 'A1' ]) : string
Parameters
$subData : string
$baseCell : string = 'A1'

Base cell

Return values
string

Cell range address

readBIFF8CellRangeAddressFixed()

Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.

private readBIFF8CellRangeAddressFixed(string $subData) : string
Parameters
$subData : string
Return values
string

readBIFF8CellRangeAddressList()

Read BIFF8 cell range address list section 2.5.15.

private readBIFF8CellRangeAddressList(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readBIFF8Constant()

read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' section 2.5.7 returns e.g. ['value' => '5', 'size' => 9].

private static readBIFF8Constant(string $valueData) : array<string|int, mixed>
Parameters
$valueData : string
Return values
array<string|int, mixed>

readBIFF8ConstantArray()

read BIFF8 constant value array from array data returns e.g. ['value' => '{1,2;3,4}', 'size' => 40] section 2.5.8.

private static readBIFF8ConstantArray(string $arrayData) : array<string|int, mixed>
Parameters
$arrayData : string
Return values
array<string|int, mixed>

readBlank()

Read BLANK record.

private readBlank() : void
Return values
void

readBof()

Read BOF.

private readBof() : void
Return values
void

readBoolErr()

Read BOOLERR record This record represents a Boolean value or error value cell.

private readBoolErr() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readBottomMargin()

Read BOTTOMMARGIN record.

private readBottomMargin() : void
Return values
void

readByteStringLong()

Read byte string (16-bit string length) OpenOffice documentation: 2.5.2.

private readByteStringLong(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readByteStringShort()

Read byte string (8-bit string length) OpenOffice documentation: 2.5.2.

private readByteStringShort(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readCFFormula()

private readCFFormula(string $recordData, int $offset, int $size) : null|float|int|string
Parameters
$recordData : string
$offset : int
$size : int
Return values
null|float|int|string

readCFHeader()

private readCFHeader() : array<string|int, mixed>
Return values
array<string|int, mixed>

readCFRule()

private readCFRule(array<string|int, mixed> $cellRangeAddresses) : void
Parameters
$cellRangeAddresses : array<string|int, mixed>
Return values
void

readCodepage()

CODEPAGE.

private readCodepage() : void

This record stores the text encoding used to write byte strings, stored as MS Windows code page identifier.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readColInfo()

Read COLINFO record.

private readColInfo() : void
Return values
void

readContinue()

Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented.

private readContinue() : void

In this case, we must treat the CONTINUE record as a MSODRAWING record.

Return values
void

readDataValidation()

Read DATAVALIDATION record.

private readDataValidation() : void
Return values
void

readDataValidations()

Read DATAVALIDATIONS record.

private readDataValidations() : void
Return values
void

readDateMode()

DATEMODE.

private readDateMode() : void

This record specifies the base date for displaying date values. All dates are stored as count of days past this base date. In BIFF2-BIFF4 this record is part of the Calculation Settings Block. In BIFF5-BIFF8 it is stored in the Workbook Globals Substream.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readDefault()

Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record.

private readDefault() : void
Return values
void

readDefaultRowHeight()

Read DEFAULTROWHEIGHT record.

private readDefaultRowHeight() : void
Return values
void

readDefColWidth()

Read DEFCOLWIDTH record.

private readDefColWidth() : void
Return values
void

readDefinedName()

DEFINEDNAME.

private readDefinedName() : void

This record is part of a Link Table. It contains the name and the token array of an internal defined name. Token arrays of defined names contain tokens with aberrant token classes.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readDocumentSummaryInformation()

Read additional document summary information.

private readDocumentSummaryInformation() : void
Return values
void

readExternalBook()

Read EXTERNALBOOK record.

private readExternalBook() : void
Return values
void

readExternName()

Read EXTERNNAME record.

private readExternName() : void
Return values
void

readExternSheet()

Read EXTERNSHEET record.

private readExternSheet() : void
Return values
void

readFilepass()

FILEPASS.

private readFilepass() : void

This record is part of the File Protection Block. It contains information about the read/write password of the file. All record contents following this record will be encrypted.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

The decryption functions and objects used from here on in are based on the source of Spreadsheet-ParseExcel: https://metacpan.org/release/Spreadsheet-ParseExcel

Return values
void

readFont()

Read a FONT record.

private readFont() : void
Return values
void

readFooter()

Read FOOTER record.

private readFooter() : void
Return values
void

readFormat()

FORMAT.

private readFormat() : void

This record contains information about a number format. All FORMAT records occur together in a sequential list.

In BIFF2-BIFF4 other records referencing a FORMAT record contain a zero-based index into this list. From BIFF5 on the FORMAT record contains the index itself that will be used by other records.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readFormula()

Read FORMULA record + perhaps a following STRING record if formula result is a string This record contains the token array and the result of a formula cell.

private readFormula() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readHcenter()

Read HCENTER record.

private readHcenter() : void
Return values
void

readHeader()

Read HEADER record.

private readHeader() : void
Return values
void

readHorizontalPageBreaks()

Read HORIZONTALPAGEBREAKS record.

private readHorizontalPageBreaks() : void
Return values
void

Read HYPERLINK record.

private readHyperLink() : void
Return values
void

readLabel()

Read LABEL record This record represents a cell that contains a string. In BIFF8 it is usually replaced by the LABELSST record.

private readLabel() : void

Excel still uses this record, if it copies unformatted text cells to the clipboard.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readLabelSst()

Read LABELSST record This record represents a cell that contains a string. It replaces the LABEL record and RSTRING record used in BIFF2-BIFF5.

private readLabelSst() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readLeftMargin()

Read LEFTMARGIN record.

private readLeftMargin() : void
Return values
void

readMergedCells()

MERGEDCELLS.

private readMergedCells() : void

This record contains the addresses of merged cell ranges in the current sheet.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readMsoDrawing()

Read MSODRAWING record.

private readMsoDrawing() : void
Return values
void

readMsoDrawingGroup()

Read MSODRAWINGGROUP record.

private readMsoDrawingGroup() : void
Return values
void

readMulBlank()

Read MULBLANK record This record represents a cell range of empty cells. All cells are located in the same row.

private readMulBlank() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readMulRk()

Read MULRK record This record represents a cell range containing RK value cells. All cells are located in the same row.

private readMulRk() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readNote()

The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions, this record stores a note (cell note). This feature was significantly enhanced in Excel 97.

private readNote() : void
Return values
void

readNumber()

Read NUMBER record This record represents a cell that contains a floating-point value.

private readNumber() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readObj()

Read OBJ record.

private readObj() : void
Return values
void

readObjectProtect()

OBJECTPROTECT.

private readObjectProtect() : void
Return values
void

readPageLayoutView()

Read PLV Record(Created by Excel2007 or upper).

private readPageLayoutView() : void
Return values
void

readPageSetup()

Read PAGESETUP record.

private readPageSetup() : void
Return values
void

readPalette()

Read PALETTE record.

private readPalette() : void
Return values
void

readPane()

Read PANE record.

private readPane() : void
Return values
void

readPassword()

PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8).

private readPassword() : void
Return values
void

readPrintGridlines()

Read PRINTGRIDLINES record.

private readPrintGridlines() : void
Return values
void

readProtect()

PROTECT - Sheet protection (BIFF2 through BIFF8) if this record is omitted, then it also means no sheet protection.

private readProtect() : void
Return values
void

readRangeProtection()

Read RANGEPROTECTION record Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification, where it is referred to as FEAT record.

private readRangeProtection() : void
Return values
void

readRecordData()

Read record data from stream, decrypting as required.

private readRecordData(string $data, int $pos, int $len) : string
Parameters
$data : string

Data stream to read from

$pos : int

Position to start reading from

$len : int

Record data length

Return values
string

Record data

readRGB()

Extract RGB color OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4.

private static readRGB(string $rgb) : array<string|int, mixed>
Parameters
$rgb : string

Encoded RGB value (4 bytes)

Return values
array<string|int, mixed>

readRightMargin()

Read RIGHTMARGIN record.

private readRightMargin() : void
Return values
void

readRk()

Read RK record This record represents a cell that contains an RK value (encoded integer or floating-point value). If a floating-point value cannot be encoded to an RK value, a NUMBER record will be written. This record replaces the record INTEGER written in BIFF2.

private readRk() : void

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readRow()

ROW.

private readRow() : void

This record contains the properties of a single row in a sheet. Rows and cells in a sheet are divided into blocks of 32 rows.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readScenProtect()

SCENPROTECT.

private readScenProtect() : void
Return values
void

readScl()

Read SCL record.

private readScl() : void
Return values
void

readSelection()

Read SELECTION record. There is one such record for each pane in the sheet.

private readSelection() : void
Return values
void

readSharedFmla()

Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader, which usually contains relative references.

private readSharedFmla() : void

These will be used to construct the formula in each shared formula part after the sheet is read.

Return values
void

readSheet()

SHEET.

private readSheet() : void

This record is located in the Workbook Globals Substream and represents a sheet inside the workbook. One SHEET record is written for each sheet. It stores the sheet name and a stream offset to the BOF record of the respective Sheet Substream within the Workbook Stream.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readSheetLayout()

Read SHEETLAYOUT record. Stores sheet tab color information.

private readSheetLayout() : void
Return values
void

readSheetPr()

Read SHEETPR record.

private readSheetPr() : void
Return values
void

readSheetProtection()

Read SHEETPROTECTION record (FEATHEADR).

private readSheetProtection() : void
Return values
void

readSheetRangeByRefIndex()

Get a sheet range like Sheet1:Sheet3 from REF index Note: If there is only one sheet in the range, one gets e.g Sheet1 It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets, in which case an Exception is thrown.

private readSheetRangeByRefIndex(int $index) : false|string
Parameters
$index : int
Return values
false|string

readSst()

SST - Shared String Table.

private readSst() : void

This record contains a list of all strings used anywhere in the workbook. Each string occurs only once. The workbook uses indexes into the list to reference the strings.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readString()

Read a STRING record from current stream position and advance the stream pointer to next record This record is used for storing result from FORMULA record when it is a string, and it occurs directly after the FORMULA record.

private readString() : string
Return values
string

The string contents as UTF-8

readStyle()

Read STYLE record.

private readStyle() : void
Return values
void

readSummaryInformation()

Read summary information.

private readSummaryInformation() : void
Return values
void

readTextObject()

The TEXT Object record contains the text associated with a cell annotation.

private readTextObject() : void
Return values
void

readTopMargin()

Read TOPMARGIN record.

private readTopMargin() : void
Return values
void

readUnicodeString()

Read Unicode string with no string length field, but with known character count this function is under construction, needs to support rich text, and Asian phonetic settings OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3.

private static readUnicodeString(string $subData, int $characterCount) : array<string|int, mixed>
Parameters
$subData : string
$characterCount : int
Return values
array<string|int, mixed>

readUnicodeStringLong()

Extracts an Excel Unicode long string (16-bit string length) OpenOffice documentation: 2.5.3 this function is under construction, needs to support rich text, and Asian phonetic settings.

private static readUnicodeStringLong(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readUnicodeStringShort()

Extracts an Excel Unicode short string (8-bit string length) OpenOffice documentation: 2.5.3 function will automatically find out where the Unicode string ends.

private static readUnicodeStringShort(string $subData) : array<string|int, mixed>
Parameters
$subData : string
Return values
array<string|int, mixed>

readVcenter()

Read VCENTER record.

private readVcenter() : void
Return values
void

readVerticalPageBreaks()

Read VERTICALPAGEBREAKS record.

private readVerticalPageBreaks() : void
Return values
void

readWindow2()

Read WINDOW2 record.

private readWindow2() : void
Return values
void

readXf()

XF - Extended Format.

private readXf() : void

This record contains formatting information for cells, rows, columns or styles. According to https://support.microsoft.com/en-us/help/147732 there are always at least 15 cell style XF and 1 cell XF. Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF and XF record 15 is a cell XF We only read the first cell style XF and skip the remaining cell style XF records We read all cell XF records.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

Return values
void

readXfExt()

private readXfExt() : void
Return values
void

setCFRules()

private setCFRules(array<string|int, mixed> $cellRanges, string $type, string $operator, null|float|int|string $formula1, null|float|int|string $formula2, Style $style) : void
Parameters
$cellRanges : array<string|int, mixed>
$type : string
$operator : string
$formula1 : null|float|int|string
$formula2 : null|float|int|string
$style : Style
Return values
void

uncompressByteString()

Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.

private static uncompressByteString(string $string) : string
Parameters
$string : string
Return values
string

UTF8toExcelDoubleQuoted()

Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.

private static UTF8toExcelDoubleQuoted(string $value) : string

Example: hello"world --> "hello""world".

Parameters
$value : string

UTF-8 encoded string

Return values
string

verifyPassword()

Verify RC4 file password.

private verifyPassword(string $password, string $docid, string $salt_data, string $hashedsalt_data, string &$valContext) : bool
Parameters
$password : string

Password to check

$docid : string

Document id

$salt_data : string

Salt data

$hashedsalt_data : string

Hashed salt data

$valContext : string

Set to the MD5 context of the value

Return values
bool

Success

Search results