diff --git a/docs/CalculationEngine/FunctionReference/01-Introduction.md b/docs/CalculationEngine/FunctionReference/01-Introduction.md index 32d11fd0..e5cd92fd 100644 --- a/docs/CalculationEngine/FunctionReference/01-Introduction.md +++ b/docs/CalculationEngine/FunctionReference/01-Introduction.md @@ -2,10 +2,10 @@ ## Frequently asked questions -The up-to-date F.A.Q. page for PHPExcel can be found on [http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements][1]. +The up-to-date F.A.Q. page for PhpSpreadsheet can be found on [http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements][1]. ### Formulas don’t seem to be calculated in Excel2003 using compatibility pack? -This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003. +This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use \PhpOffice\PhpSpreadsheet\Writer\Xls if you really need calculated values, or force recalculation in Excel2003. [1]: http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements diff --git a/docs/CalculationEngine/FunctionReference/02-01-Date-and-Time-Handling.md b/docs/CalculationEngine/FunctionReference/02-01-Date-and-Time-Handling.md index 82993bbc..b45a9a0c 100644 --- a/docs/CalculationEngine/FunctionReference/02-01-Date-and-Time-Handling.md +++ b/docs/CalculationEngine/FunctionReference/02-01-Date-and-Time-Handling.md @@ -8,24 +8,24 @@ Any of the Date and Time functions that return a date value in Excel can return either an Excel timestamp or a PHP timestamp or date object. -It is possible for scripts to change the data type used for returning date values by calling the PHPExcel_Calculation_Functions::setReturnDateType() method: +It is possible for scripts to change the data type used for returning date values by calling the \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType() method: ```php -PHPExcel_Calculation_Functions::setReturnDateType($returnDateType); +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($returnDateType); ``` where the following constants can be used for $returnDateType - - PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC - - PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT - - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL + - \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC + - \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_OBJECT + - \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL The method will return a Boolean True on success, False on failure (e.g. if an invalid value is passed in for the return date type). -The PHPExcel_Calculation_Functions::getReturnDateType() method can be used to determine the current value of this setting: +The \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType() method can be used to determine the current value of this setting: ```php -$returnDateType = PHPExcel_Calculation_Functions::getReturnDateType(); +$returnDateType = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); ``` The default is RETURNDATE_PHP_NUMERIC. @@ -42,23 +42,23 @@ If the Return Date Type is set for RETURNDATE_PHP_NUMERIC, then any date value r If RETURNDATE_EXCEL is set for the Return Date Type, then the returned date value by any access to the Date and Time functions in Excel will be a floating point value that represents a number of days from the Excel base date. The Excel base date is determined by which calendar Excel uses: the Windows 1900 or the Mac 1904 calendar. 1st January 1900 is the base date for the Windows 1900 calendar while 1st January 1904 is the base date for the Mac 1904 calendar. -It is possible for scripts to change the calendar used for calculating Excel date values by calling the PHPExcel_Shared_Date::setExcelCalendar() method: +It is possible for scripts to change the calendar used for calculating Excel date values by calling the \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar() method: ```php -PHPExcel_Shared_Date::setExcelCalendar($baseDate); +\PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar($baseDate); ``` where the following constants can be used for $baseDate - - PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900 - - PHPExcel_Shared_Date::CALENDAR_MAC_1904 + - \PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900 + - \PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904 The method will return a Boolean True on success, False on failure (e.g. if an invalid value is passed in). -The PHPExcel_Shared_Date::getExcelCalendar() method can be used to determine the current value of this setting: +The \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar() method can be used to determine the current value of this setting: ```php -$baseDate = PHPExcel_Shared_Date::getExcelCalendar(); +$baseDate = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar(); ``` The default is CALENDAR_WINDOWS_1900. @@ -75,9 +75,9 @@ The default is CALENDAR_WINDOWS_1900. #### Excel functions that accept Date and Time values as parameters -Date values passed in as parameters to a function can be an Excel timestamp or a PHP timestamp; or date object; or a string containing a date value (e.g. '1-Jan-2009'). PHPExcel will attempt to identify their type based on the PHP datatype: +Date values passed in as parameters to a function can be an Excel timestamp or a PHP timestamp; or date object; or a string containing a date value (e.g. '1-Jan-2009'). PhpSpreadsheet will attempt to identify their type based on the PHP datatype: -An integer numeric value will be treated as a PHP/Unix timestamp. A real (floating point) numeric value will be treated as an Excel date/timestamp. Any PHP DateTime object will be treated as a DateTime object. Any string value (even one containing straight numeric data) will be converted to a date/time object for validation as a date value based on the server locale settings, so passing through an ambiguous value of '07/08/2008' will be treated as 7th August 2008 if your server settings are UK, but as 8th July 2008 if your server settings are US. However, if you pass through a value such as '31/12/2008' that would be considered an error by a US-based server, but which is not ambiguous, then PHPExcel will attempt to correct this to 31st December 2008. If the content of the string doesn’t match any of the formats recognised by the php date/time object implementation of strtotime() (which can handle a wider range of formats than the normal strtotime() function), then the function will return a '#VALUE' error. However, Excel recommends that you should always use date/timestamps for your date functions, and the recommendation for PHPExcel is the same: avoid strings because the result is not predictable. +An integer numeric value will be treated as a PHP/Unix timestamp. A real (floating point) numeric value will be treated as an Excel date/timestamp. Any PHP DateTime object will be treated as a DateTime object. Any string value (even one containing straight numeric data) will be converted to a date/time object for validation as a date value based on the server locale settings, so passing through an ambiguous value of '07/08/2008' will be treated as 7th August 2008 if your server settings are UK, but as 8th July 2008 if your server settings are US. However, if you pass through a value such as '31/12/2008' that would be considered an error by a US-based server, but which is not ambiguous, then PhpSpreadsheet will attempt to correct this to 31st December 2008. If the content of the string doesn’t match any of the formats recognised by the php date/time object implementation of strtotime() (which can handle a wider range of formats than the normal strtotime() function), then the function will return a '#VALUE' error. However, Excel recommends that you should always use date/timestamps for your date functions, and the recommendation for PhpSpreadsheet is the same: avoid strings because the result is not predictable. The same principle applies when data is being written to Excel. Cells containing date actual values (rather than Excel functions that return a date value) are always written as Excel dates, converting where necessary. If a cell formatted as a date contains an integer or date/time object value, then it is converted to an Excel value for writing: if a cell formatted as a date contains a real value, then no conversion is required. Note that string values are written as strings rather than converted to Excel date timestamp values. @@ -101,23 +101,23 @@ The same principle applies when data is being written to Excel. Cells containing #### Helper Methods -In addition to the setExcelCalendar() and getExcelCalendar() methods, a number of other methods are available in the PHPExcel_Shared_Date class that can help when working with dates: +In addition to the setExcelCalendar() and getExcelCalendar() methods, a number of other methods are available in the \PhpOffice\PhpSpreadsheet\Shared\Date class that can help when working with dates: -##### PHPExcel_Shared_Date::ExcelToPHP($excelDate) +##### \PhpOffice\PhpSpreadsheet\Shared\Date::ExcelToPHP($excelDate) Converts a date/time from an Excel date timestamp to return a PHP serialized date/timestamp. Note that this method does not trap for Excel dates that fall outside of the valid range for a PHP date timestamp. -##### PHPExcel_Shared_Date::ExcelToPHPObject($excelDate) +##### \PhpOffice\PhpSpreadsheet\Shared\Date::ExcelToPHPObject($excelDate) Converts a date from an Excel date/timestamp to return a PHP DateTime object. -##### PHPExcel_Shared_Date::PHPToExcel($PHPDate) +##### \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDate) Converts a PHP serialized date/timestamp or a PHP DateTime object to return an Excel date timestamp. -##### PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day, $hours=0, $minutes=0, $seconds=0) +##### \PhpOffice\PhpSpreadsheet\Shared\Date::FormattedPHPToExcel($year, $month, $day, $hours=0, $minutes=0, $seconds=0) Takes year, month and day values (and optional hour, minute and second values) and returns an Excel date timestamp value. diff --git a/docs/CalculationEngine/FunctionReference/02-General-Introduction.md b/docs/CalculationEngine/FunctionReference/02-General-Introduction.md index feaa239c..c92145d7 100644 --- a/docs/CalculationEngine/FunctionReference/02-General-Introduction.md +++ b/docs/CalculationEngine/FunctionReference/02-General-Introduction.md @@ -6,7 +6,7 @@ Not all functions are supported by the Excel 5 Writer. Use of these functions within your workbooks will result in an error when trying to write to Xls. -The following is the list of those functions that are implemented within PHPExcel, but that cannot currently be written to Excel 5. +The following is the list of those functions that are implemented within PhpSpreadsheet, but that cannot currently be written to Excel 5. #### Cube Functions @@ -31,6 +31,6 @@ The following is the list of those functions that are implemented within PHPExce Excel Function | Notes ---------------|--------- - EDATE | Not a standard function within Excel 5, but an add-in from the Analysis ToolPak. + EDATE | Not a standard function within Excel 5, but an add-in from the Analysis ToolPak. EOMONTH | Not a standard function within Excel 5, but an add-in from the Analysis ToolPak. diff --git a/docs/CalculationEngine/FunctionReference/03-02-Database-Functions.md b/docs/CalculationEngine/FunctionReference/03-02-Database-Functions.md index a50e1c85..518375e5 100644 --- a/docs/CalculationEngine/FunctionReference/03-02-Database-Functions.md +++ b/docs/CalculationEngine/FunctionReference/03-02-Database-Functions.md @@ -16,15 +16,15 @@ DAVERAGE (database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -37,7 +37,7 @@ This is the statistical mean. ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -47,7 +47,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -78,15 +78,15 @@ DCOUNT(database, [field], criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -97,7 +97,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -107,7 +107,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -125,7 +125,7 @@ $retVal = $worksheet->getCell('A12')->getCalculatedValue(); ##### Notes -In MS Excel, The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match the criteria. This logic has not yet been implemented in PHPExcel. +In MS Excel, The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match the criteria. This logic has not yet been implemented in PhpSpreadsheet. #### DCOUNTA @@ -139,15 +139,15 @@ DCOUNTA(database, [field], criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -158,7 +158,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -168,7 +168,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -186,7 +186,7 @@ $retVal = $worksheet->getCell('A12')->getCalculatedValue(); ##### Notes -In MS Excel, The field argument is optional. If field is omitted, DCOUNTA counts all records in the database that match the criteria. This logic has not yet been implemented in PHPExcel. +In MS Excel, The field argument is optional. If field is omitted, DCOUNTA counts all records in the database that match the criteria. This logic has not yet been implemented in PhpSpreadsheet. #### DGET @@ -200,15 +200,15 @@ DGET(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -219,7 +219,7 @@ You can use any range for the criteria argument, as long as it includes at least #### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -229,7 +229,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -260,15 +260,15 @@ DMAX(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -279,7 +279,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -289,7 +289,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -320,15 +320,15 @@ DMIN(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -339,7 +339,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -349,7 +349,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -380,15 +380,15 @@ DPRODUCT(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -399,7 +399,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -409,7 +409,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -440,15 +440,15 @@ DSTDEV(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -459,7 +459,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -469,7 +469,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -500,15 +500,15 @@ DSTDEVP(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -519,7 +519,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -529,7 +529,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), @@ -560,15 +560,15 @@ DSUM(database, field, criteria) ##### Parameters -**database** The range of cells that makes up the list or database. +**database** The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. -**field** Indicates which column of the database is used in the function. +**field** Indicates which column of the database is used in the function. Enter the column label as a string (enclosed between double quotation marks), such as "Age" or "Yield," or as a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. -**criteria** The range of cells that contains the conditions you specify. +**criteria** The range of cells that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. @@ -579,7 +579,7 @@ You can use any range for the criteria argument, as long as it includes at least ##### Examples ```php -$database = array( +$database = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit' ), array( 'Apple', 18, 20, 14, 105.00 ), array( 'Pear', 12, 12, 10, 96.00 ), @@ -589,7 +589,7 @@ $database = array( array( 'Apple', 8, 9, 6, 45.00 ), ); -$criteria = array( +$criteria = array( array( 'Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height' ), array( '="=Apple"', '>10', NULL, NULL, NULL, '<16' ), array( '="=Pear"', NULL, NULL, NULL, NULL, NULL ), diff --git a/docs/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md b/docs/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md index ea33bedd..6c7f52b8 100644 --- a/docs/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md +++ b/docs/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md @@ -4,7 +4,7 @@ ### Date and Time Functions -Excel provides a number of functions for the manipulation of dates and times, and calculations based on date/time values. it is worth spending some time reading the section titled "Date and Time Values" on passing date parameters and returning date values to understand how PHPExcel reconciles the differences between dates and times in Excel and in PHP. +Excel provides a number of functions for the manipulation of dates and times, and calculations based on date/time values. it is worth spending some time reading the section titled "Date and Time Values" on passing date parameters and returning date values to understand how PhpSpreadsheet reconciles the differences between dates and times in Excel and in PHP. #### DATE @@ -18,17 +18,17 @@ DATE(year, month, day) ##### Parameters -**year** The year number. +**year** The year number. -If this value is between 0 (zero) and 1899 inclusive (for the Windows 1900 calendar), or between 4 and 1903 inclusive (for the Mac 1904), then PHPExcel adds it to the Calendar base year, so a value of 108 will interpret the year as 2008 when using the Windows 1900 calendar, or 2012 when using the Mac 1904 calendar. +If this value is between 0 (zero) and 1899 inclusive (for the Windows 1900 calendar), or between 4 and 1903 inclusive (for the Mac 1904), then PhpSpreadsheet adds it to the Calendar base year, so a value of 108 will interpret the year as 2008 when using the Windows 1900 calendar, or 2012 when using the Mac 1904 calendar. -**month** The month number. +**month** The month number. If this value is greater than 12, the DATE function adds that number of months to the first month in the year specified. For example, DATE(2008,14,2) returns a value representing February 2, 2009. If the value of __month__ is less than 1, then that value will be adjusted by -1, and that will then be subtracted from the first month of the year specified. For example, DATE(2008,0,2) returns a value representing December 2, 2007; while DATE(2008,-1,2) returns a value representing November 2, 2007. -**day** The day number. +**day** The day number. If this value is greater than the number of days in the month (and year) specified, the DATE function adds that number of days to the first day in the month. For example, DATE(2008,1,35) returns a value representing February 4, 2008. @@ -36,9 +36,9 @@ If the value of __day__ is less than 1, then that value will be adjusted by -1, ##### Return Value -**mixed** A date/time stamp that corresponds to the given date. +**mixed** A date/time stamp that corresponds to the given date. -This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of PHPExcel_Calculation_Functions::getReturnDateType(). +This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). ##### Examples @@ -60,31 +60,31 @@ $retVal = $worksheet->getCell('D1')->getCalculatedValue(); ```php // We're going to be calling the same cell calculation multiple times, // and expecting different return values, so disable calculation cacheing -PHPExcel_Calculation::getInstance()->setCalculationCacheEnabled(FALSE); +\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->setCalculationCacheEnabled(FALSE); -$saveFormat = PHPExcel_Calculation_Functions::getReturnDateType(); +$saveFormat = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATE'), array(2008, 12, 31) ); // $retVal = 39813.0 -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATE'), array(2008, 12, 31) ); // $retVal = 1230681600 -PHPExcel_Calculation_Functions::setReturnDateType($saveFormat); +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveFormat); ``` ##### Notes @@ -103,15 +103,15 @@ DATEDIF(date1, date2 [, unit]) ##### Parameters -**date1** First Date. +**date1** First Date. An Excel date value, PHP date timestamp, PHP date object, or a date represented as a string. -**date2** Second Date. +**date2** Second Date. An Excel date value, PHP date timestamp, PHP date object, or a date represented as a string. -**unit** The interval type to use for the calculation +**unit** The interval type to use for the calculation This is a string, comprising one of the values listed below: @@ -128,7 +128,7 @@ The unit value is not case sensitive, and defaults to "d". ##### Return Value -**integer** An integer value that reflects the difference between the two dates. +**integer** An integer value that reflects the difference between the two dates. This could be the number of full days, months or years between the two dates, depending on the interval unit value passed into the function as the third parameter. @@ -177,37 +177,37 @@ $date1 = 1193317015; // PHP timestamp for 25-Oct-2007 $date2 = 1449579415; // PHP timestamp for 8-Dec-2015 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'd') ); // $retVal = 2966 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'm') ); // $retVal = 97 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'y') ); // $retVal = 8 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'ym') ); // $retVal = 1 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'yd') ); // $retVal = 44 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEDIF'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEDIF'), array($date1, $date2, 'md') ); // $retVal = 13 @@ -229,15 +229,15 @@ DATEVALUE(dateString) ##### Parameters -**date** Date String. +**date** Date String. A string, representing a date value. ##### Return Value -**mixed** A date/time stamp that corresponds to the given date. +**mixed** A date/time stamp that corresponds to the given date. -This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of PHPExcel_Calculation_Functions::getReturnDateType(). +This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). ##### Examples @@ -251,8 +251,8 @@ $worksheet->setCellValue('B2', '=DATEVALUE(A2)') ->setCellValue('B3', '=DATEVALUE(A3)') ->setCellValue('B4', '=DATEVALUE(A4)'); -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = $worksheet->getCell('B2')->getCalculatedValue(); @@ -266,38 +266,38 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php // We're going to be calling the same cell calculation multiple times, // and expecting different return values, so disable calculation cacheing -PHPExcel_Calculation::getInstance()->setCalculationCacheEnabled(FALSE); +\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->setCalculationCacheEnabled(FALSE); -$saveFormat = PHPExcel_Calculation_Functions::getReturnDateType(); +$saveFormat = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEVALUE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEVALUE'), array('31-Dec-2008') ); // $retVal = 39813.0 -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DATEVALUE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DATEVALUE'), array('31-Dec-2008') ); // $retVal = 1230681600 -PHPExcel_Calculation_Functions::setReturnDateType($saveFormat); +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveFormat); ``` ##### Notes DATEVALUE uses the php date/time object implementation of strtotime() (which can handle a wider range of formats than the normal strtotime() function), and it is also called for any date parameter passed to other date functions (such as DATEDIF) when the parameter value is a string. -__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value. +__WARNING:-__ PhpSpreadsheet accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PhpSpreadsheet is able to translate that same string into a correct date value. Care should be taken in workbooks that use string formatted dates in calculations when writing to Xls or Xlsx. @@ -313,7 +313,7 @@ DAY(datetime) ##### Parameters -**datetime** Date. +**datetime** Date. An Excel date value, PHP date timestamp, PHP date object, or a date represented as a string. @@ -342,7 +342,7 @@ $retVal = $worksheet->getCell('B3')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DAYOFMONTH'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DAYOFMONTH'), array('25-Dec-2008') ); // $retVal = 25 @@ -350,7 +350,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::DAYOFMONTH() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::DAYOFMONTH() when the method is called statically. #### DAYS360 @@ -364,11 +364,11 @@ DAYS360(date1, date2 [, method]) #### Parameters -**date1** First Date. +**date1** First Date. An Excel date value, PHP date timestamp, PHP date object, or a date represented as a string. -**date2** Second Date. +**date2** Second Date. An Excel date value, PHP date timestamp, PHP date object, or a date represented as a string. @@ -421,13 +421,13 @@ $date1 = 37655.0; // Excel timestamp for 25-Oct-2007 $date2 = 39233.0; // Excel timestamp for 8-Dec-2015 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DAYS360'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DAYS360'), array($date1, $date2) ); // $retVal = 1558 $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'DAYS360'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'DAYS360'), array($date1, $date2, TRUE) ); // $retVal = 1557 @@ -461,7 +461,7 @@ An integer value indicating the number of months before or after baseDate. A pos **mixed** A date/time stamp that corresponds to the basedate + months. -This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of PHPExcel_Calculation_Functions::getReturnDateType(). +This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). ##### Examples @@ -473,8 +473,8 @@ $worksheet->setCellValue('A1', 'Date String') $worksheet->setCellValue('B2', '=EDATE(A2,5)') ->setCellValue('B3', '=EDATE(A3,-12)'); -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = $worksheet->getCell('B2')->getCalculatedValue(); @@ -485,12 +485,12 @@ $retVal = $worksheet->getCell('B3')->getCalculatedValue(); ``` ```php -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'EDATE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'EDATE'), array('31-Oct-2008',25) ); // $retVal = 40512.0 (30-Nov-2010) @@ -524,7 +524,7 @@ An integer value indicating the number of months before or after baseDate. A pos **mixed** A date/time stamp that corresponds to the last day of basedate + months. -This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of PHPExcel_Calculation_Functions::getReturnDateType(). +This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). ##### Examples @@ -536,7 +536,7 @@ $worksheet->setCellValue('A1', 'Date String') $worksheet->setCellValue('B2', '=EOMONTH(A2,5)') ->setCellValue('B3', '=EOMONTH(A3,-12)'); -PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL); $retVal = $worksheet->getCell('B2')->getCalculatedValue(); // $retVal = 39629.0 (30-Jun-2008) @@ -546,12 +546,12 @@ $retVal = $worksheet->getCell('B3')->getCalculatedValue(); ``` ```php -PHPExcel_Calculation_Functions::setReturnDateType( - PHPExcel_Calculation_Functions::RETURNDATE_EXCEL +\PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType( + \PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL ); $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'EOMONTH'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'EOMONTH'), array('31-Oct-2008',13) ); // $retVal = 40147.0 (30-Nov-2010) @@ -607,7 +607,7 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'HOUROFDAY'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'HOUROFDAY'), array('09:30') ); // $retVal = 9 @@ -615,7 +615,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::HOUROFDAY() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::HOUROFDAY() when the method is called statically. #### MINUTE @@ -663,7 +663,7 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'MINUTE'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'MINUTE'), array('09:30') ); // $retVal = 30 @@ -671,7 +671,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::MINUTE() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::MINUTE() when the method is called statically. #### MONTH @@ -714,7 +714,7 @@ $retVal = $worksheet->getCell('B3')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'MONTHOFYEAR'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'MONTHOFYEAR'), array('14-July-2008') ); // $retVal = 7 @@ -722,7 +722,7 @@ $retVal = call_user_func_array( #### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::MONTHOFYEAR() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::MONTHOFYEAR() when the method is called statically. #### NETWORKDAYS @@ -786,7 +786,7 @@ There are now parameters for the NOW() function. **mixed** A date/time stamp that corresponds to the current date and time. -This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of PHPExcel_Calculation_Functions::getReturnDateType(). +This could be a PHP timestamp value (integer), a PHP date/time object, or an Excel timestamp value (real), depending on the value of \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). ##### Examples @@ -798,7 +798,7 @@ This could be a PHP timestamp value (integer), a PHP date/time object, or an Exc ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::DATETIMENOW() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::DATETIMENOW() when the method is called statically. #### SECOND @@ -846,7 +846,7 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'SECOND'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'SECOND'), array('09:30:17') ); // $retVal = 17 @@ -854,7 +854,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::SECOND() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::SECOND() when the method is called statically. #### TIME @@ -925,7 +925,7 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'WEEKDAY'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'WEEKDAY'), array('14-July-2008') ); // $retVal = 7 @@ -933,7 +933,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::WEEKDAY() when the method is called statically. +Note that the PhpSpreadsheet function is \PhpOffice\PhpSpreadsheet\Calculation\Functions::WEEKDAY() when the method is called statically. #### WEEKNUM @@ -984,7 +984,7 @@ $retVal = $worksheet->getCell('B3')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'YEAR'), + array('\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'YEAR'), array('14-July-2001') ); // $retVal = 2001 diff --git a/docs/Examples/Calculations/Database/DAVERAGE.php b/docs/Examples/Calculations/Database/DAVERAGE.php index 29568836..650e1324 100644 --- a/docs/Examples/Calculations/Database/DAVERAGE.php +++ b/docs/Examples/Calculations/Database/DAVERAGE.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DCOUNT.php b/docs/Examples/Calculations/Database/DCOUNT.php index 8c3f3d84..22669b36 100644 --- a/docs/Examples/Calculations/Database/DCOUNT.php +++ b/docs/Examples/Calculations/Database/DCOUNT.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DGET.php b/docs/Examples/Calculations/Database/DGET.php index 7fcec8cb..6a133426 100644 --- a/docs/Examples/Calculations/Database/DGET.php +++ b/docs/Examples/Calculations/Database/DGET.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DMAX.php b/docs/Examples/Calculations/Database/DMAX.php index 5dd3bae0..18936c5b 100644 --- a/docs/Examples/Calculations/Database/DMAX.php +++ b/docs/Examples/Calculations/Database/DMAX.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +// Create new PhpSpreadsheet object +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DMIN.php b/docs/Examples/Calculations/Database/DMIN.php index c03c6264..0184173b 100644 --- a/docs/Examples/Calculations/Database/DMIN.php +++ b/docs/Examples/Calculations/Database/DMIN.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +// Create new PhpSpreadsheet object +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DPRODUCT.php b/docs/Examples/Calculations/Database/DPRODUCT.php index 3480534b..41d60a2f 100644 --- a/docs/Examples/Calculations/Database/DPRODUCT.php +++ b/docs/Examples/Calculations/Database/DPRODUCT.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +// Create new PhpSpreadsheet object +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DSTDEV.php b/docs/Examples/Calculations/Database/DSTDEV.php index 8fc8eaf4..2fbbda20 100644 --- a/docs/Examples/Calculations/Database/DSTDEV.php +++ b/docs/Examples/Calculations/Database/DSTDEV.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +// Create new PhpSpreadsheet object +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DSTDEVP.php b/docs/Examples/Calculations/Database/DSTDEVP.php index 284d6ba6..1f0a0fe6 100644 --- a/docs/Examples/Calculations/Database/DSTDEVP.php +++ b/docs/Examples/Calculations/Database/DSTDEVP.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +// Create new PhpSpreadsheet object +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DVAR.php b/docs/Examples/Calculations/Database/DVAR.php index 9f660e2c..00bd97aa 100644 --- a/docs/Examples/Calculations/Database/DVAR.php +++ b/docs/Examples/Calculations/Database/DVAR.php @@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London'); -PHPExcel Calculation Examples +PhpSpreadsheet Calculation Examples @@ -22,12 +22,12 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); -/** Include PHPExcel */ +/** Include PhpSpreadsheet */ include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PhpSpreadsheet(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/Database/DVARP.php b/docs/Examples/Calculations/Database/DVARP.php index 80dee77a..c6cc0677 100644 --- a/docs/Examples/Calculations/Database/DVARP.php +++ b/docs/Examples/Calculations/Database/DVARP.php @@ -26,8 +26,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'], diff --git a/docs/Examples/Calculations/DateTime/DATE.php b/docs/Examples/Calculations/DateTime/DATE.php index e2c47216..8fe88340 100644 --- a/docs/Examples/Calculations/DateTime/DATE.php +++ b/docs/Examples/Calculations/DateTime/DATE.php @@ -26,8 +26,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $testDates = [[2012, 3, 26], [2012, 2, 29], [2012, 4, 1], [2012, 12, 25], diff --git a/docs/Examples/Calculations/DateTime/DATEVALUE.php b/docs/Examples/Calculations/DateTime/DATEVALUE.php index 481a52e4..03468145 100644 --- a/docs/Examples/Calculations/DateTime/DATEVALUE.php +++ b/docs/Examples/Calculations/DateTime/DATEVALUE.php @@ -26,8 +26,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $testDates = ['26 March 2012', '29 Feb 2012', 'April 1, 2012', '25/12/2012', diff --git a/docs/Examples/Calculations/DateTime/TIME.php b/docs/Examples/Calculations/DateTime/TIME.php index 19654a77..d2cafb28 100644 --- a/docs/Examples/Calculations/DateTime/TIME.php +++ b/docs/Examples/Calculations/DateTime/TIME.php @@ -26,8 +26,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $testDates = [[3, 15], [13, 15], [15, 15, 15], [3, 15, 30], diff --git a/docs/Examples/Calculations/DateTime/TIMEVALUE.php b/docs/Examples/Calculations/DateTime/TIMEVALUE.php index de351d5a..2ebada32 100644 --- a/docs/Examples/Calculations/DateTime/TIMEVALUE.php +++ b/docs/Examples/Calculations/DateTime/TIMEVALUE.php @@ -26,8 +26,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/'); include 'PHPExcel.php'; // Create new PHPExcel object -$objPHPExcel = new PHPExcel(); -$worksheet = $objPHPExcel->getActiveSheet(); +$spreadsheet = new PHPExcel(); +$worksheet = $spreadsheet->getActiveSheet(); // Add some data $testDates = ['3:15', '13:15', '15:15:15', '3:15 AM', '3:15 PM', '5PM', '9:15AM', '13:15AM', diff --git a/docs/Examples/Reader/exampleReader01.php b/docs/Examples/Reader/exampleReader01.php index 09fdfa2d..1bad76d8 100644 --- a/docs/Examples/Reader/exampleReader01.php +++ b/docs/Examples/Reader/exampleReader01.php @@ -16,22 +16,22 @@ date_default_timezone_set('Europe/London');

PHPExcel Reader Example #01

-

Simple File Reader using PHPExcel_IOFactory::load()

+

Simple File Reader using \PhpOffice\PhpSpreadsheet\IOFactory::load()

'; -$objPHPExcel = PHPExcel_IOFactory::load($inputFileName); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader02.php b/docs/Examples/Reader/exampleReader02.php index 26c41ecd..b88d2cf0 100644 --- a/docs/Examples/Reader/exampleReader02.php +++ b/docs/Examples/Reader/exampleReader02.php @@ -8,7 +8,7 @@ date_default_timezone_set('Europe/London'); /* Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; ?> @@ -27,19 +27,19 @@ include 'PHPExcel/IOFactory.php'; $inputFileName = './sampleData/example1.xls'; -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using PHPExcel_Reader_Excel5
'; -$objReader = new PHPExcel_Reader_Excel5(); -// $objReader = new PHPExcel_Reader_Excel2007(); -// $objReader = new PHPExcel_Reader_Excel2003XML(); -// $objReader = new PHPExcel_Reader_OOCalc(); -// $objReader = new PHPExcel_Reader_SYLK(); -// $objReader = new PHPExcel_Reader_Gnumeric(); -// $objReader = new PHPExcel_Reader_CSV(); -$objPHPExcel = $objReader->load($inputFileName); +echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using \PhpOffice\PhpSpreadsheet\Reader\Xls
'; +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Ods(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\SYLK(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Gnumeric(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\CSV(); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader03.php b/docs/Examples/Reader/exampleReader03.php index 6b96de1e..66db14fc 100644 --- a/docs/Examples/Reader/exampleReader03.php +++ b/docs/Examples/Reader/exampleReader03.php @@ -16,13 +16,13 @@ date_default_timezone_set('Europe/London');

PHPExcel Reader Example #03

-

Simple File Reader using the PHPExcel_IOFactory to Return a Reader

+

Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Return a Reader

'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); -$objPHPExcel = $objReader->load($inputFileName); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader04.php b/docs/Examples/Reader/exampleReader04.php index 5f1b0031..7d593af5 100644 --- a/docs/Examples/Reader/exampleReader04.php +++ b/docs/Examples/Reader/exampleReader04.php @@ -16,27 +16,27 @@ date_default_timezone_set('Europe/London');

PHPExcel Reader Example #04

-

Simple File Reader using the PHPExcel_IOFactory to Identify a Reader to Use

+

Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Identify a Reader to Use

'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with the identified reader type
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); -$objPHPExcel = $objReader->load($inputFileName); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader05.php b/docs/Examples/Reader/exampleReader05.php index f4c30c0f..b839d80c 100644 --- a/docs/Examples/Reader/exampleReader05.php +++ b/docs/Examples/Reader/exampleReader05.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -33,14 +33,14 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Turning Formatting off for Load
'; $objReader->setReadDataOnly(true); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader06.php b/docs/Examples/Reader/exampleReader06.php index d205c1d6..29280da0 100644 --- a/docs/Examples/Reader/exampleReader06.php +++ b/docs/Examples/Reader/exampleReader06.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -33,15 +33,15 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading all WorkSheets
'; $objReader->setLoadAllSheets(); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo $sheetIndex,' -> ',$loadedSheetName,'
'; } diff --git a/docs/Examples/Reader/exampleReader07.php b/docs/Examples/Reader/exampleReader07.php index 258993d8..2c05c353 100644 --- a/docs/Examples/Reader/exampleReader07.php +++ b/docs/Examples/Reader/exampleReader07.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -34,15 +34,15 @@ $inputFileName = './sampleData/example1.xls'; $sheetname = 'Data Sheet #2'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading Sheet "',$sheetname,'" only
'; $objReader->setLoadSheetsOnly($sheetname); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo $sheetIndex,' -> ',$loadedSheetName,'
'; } diff --git a/docs/Examples/Reader/exampleReader08.php b/docs/Examples/Reader/exampleReader08.php index fc445531..97f4700b 100644 --- a/docs/Examples/Reader/exampleReader08.php +++ b/docs/Examples/Reader/exampleReader08.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -34,15 +34,15 @@ $inputFileName = './sampleData/example1.xls'; $sheetnames = ['Data Sheet #1', 'Data Sheet #3']; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading Sheet',((count($sheetnames) == 1) ? '' : 's'),' "',implode('" and "', $sheetnames),'" only
'; $objReader->setLoadSheetsOnly($sheetnames); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo $sheetIndex,' -> ',$loadedSheetName,'
'; } diff --git a/docs/Examples/Reader/exampleReader09.php b/docs/Examples/Reader/exampleReader09.php index 9b33d0c0..25b17c58 100644 --- a/docs/Examples/Reader/exampleReader09.php +++ b/docs/Examples/Reader/exampleReader09.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -33,7 +33,7 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; $sheetname = 'Data Sheet #3'; -class MyReadFilter implements PHPExcel_Reader_IReadFilter +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { @@ -51,16 +51,16 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter $filterSubset = new MyReadFilter(); echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading Sheet "',$sheetname,'" only
'; $objReader->setLoadSheetsOnly($sheetname); echo 'Loading Sheet using filter
'; $objReader->setReadFilter($filterSubset); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader10.php b/docs/Examples/Reader/exampleReader10.php index d5dc9316..fb92f683 100644 --- a/docs/Examples/Reader/exampleReader10.php +++ b/docs/Examples/Reader/exampleReader10.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -33,7 +33,7 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; $sheetname = 'Data Sheet #3'; -class MyReadFilter implements PHPExcel_Reader_IReadFilter +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; @@ -63,16 +63,16 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter $filterSubset = new MyReadFilter(9, 15, range('G', 'K')); echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading Sheet "',$sheetname,'" only
'; $objReader->setLoadSheetsOnly($sheetname); echo 'Loading Sheet using configurable filter
'; $objReader->setReadFilter($filterSubset); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader11.php b/docs/Examples/Reader/exampleReader11.php index ad4c05b9..9bbbbe9e 100644 --- a/docs/Examples/Reader/exampleReader11.php +++ b/docs/Examples/Reader/exampleReader11.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -32,8 +32,8 @@ $inputFileType = 'Xls'; // $inputFileType = 'Gnumeric'; $inputFileName = './sampleData/example2.xls'; -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class chunkReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; @@ -59,7 +59,7 @@ class chunkReadFilter implements PHPExcel_Reader_IReadFilter echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo '
'; @@ -74,11 +74,11 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { /* Tell the Reader that we want to use the new Read Filter that we've just Instantiated **/ $objReader->setReadFilter($chunkFilter); /* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/ - $objPHPExcel = $objReader->load($inputFileName); + $spreadsheet = $objReader->load($inputFileName); // Do some processing here - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); echo '

'; } diff --git a/docs/Examples/Reader/exampleReader12.php b/docs/Examples/Reader/exampleReader12.php index 8219a0d9..0330de73 100644 --- a/docs/Examples/Reader/exampleReader12.php +++ b/docs/Examples/Reader/exampleReader12.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Set Include path to point at the PHPExcel Classes folder **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** Include PHPExcel_IOFactory **/ +/** Include \PhpOffice\PhpSpreadsheet\IOFactory **/ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -32,8 +32,8 @@ $inputFileType = 'Xls'; // $inputFileType = 'Gnumeric'; $inputFileName = './sampleData/example2.xls'; -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class chunkReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; @@ -59,7 +59,7 @@ class chunkReadFilter implements PHPExcel_Reader_IReadFilter echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo '
'; @@ -77,11 +77,11 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { /* Tell the Read Filter, the limits on which rows we want to read this iteration **/ $chunkFilter->setRows($startRow, $chunkSize); /* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/ - $objPHPExcel = $objReader->load($inputFileName); + $spreadsheet = $objReader->load($inputFileName); // Do some processing here - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); echo '

'; } diff --git a/docs/Examples/Reader/exampleReader13.php b/docs/Examples/Reader/exampleReader13.php index f489e98d..5d53a87b 100644 --- a/docs/Examples/Reader/exampleReader13.php +++ b/docs/Examples/Reader/exampleReader13.php @@ -22,32 +22,32 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'CSV'; $inputFileNames = ['./sampleData/example1.csv', './sampleData/example2.csv']; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $inputFileName = array_shift($inputFileNames); echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objPHPExcel = $objReader->load($inputFileName); -$objPHPExcel->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); +$spreadsheet = $objReader->load($inputFileName); +$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); foreach ($inputFileNames as $sheet => $inputFileName) { echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'
'; $objReader->setSheetIndex($sheet + 1); - $objReader->loadIntoExisting($inputFileName, $objPHPExcel); - $objPHPExcel->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); + $objReader->loadIntoExisting($inputFileName, $spreadsheet); + $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); } echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo 'Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'
'; - $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); + $spreadsheet->setActiveSheetIndexByName($loadedSheetName); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); echo '

'; } diff --git a/docs/Examples/Reader/exampleReader14.php b/docs/Examples/Reader/exampleReader14.php index c101d53d..ae402e54 100644 --- a/docs/Examples/Reader/exampleReader14.php +++ b/docs/Examples/Reader/exampleReader14.php @@ -17,14 +17,14 @@ /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'CSV'; $inputFileName = './sampleData/example2.csv'; -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class chunkReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; @@ -50,7 +50,7 @@ class chunkReadFilter implements PHPExcel_Reader_IReadFilter echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo '
'; @@ -65,7 +65,7 @@ $objReader->setReadFilter($chunkFilter) ->setContiguous(true); /* Instantiate a new PHPExcel object manually **/ -$objPHPExcel = new PHPExcel(); +$spreadsheet = new PHPExcel(); /* Set a sheet index **/ $sheet = 0; @@ -79,20 +79,20 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { /* Increment the worksheet index pointer for the Reader **/ $objReader->setSheetIndex($sheet); /* Load only the rows that match our filter into a new worksheet in the PHPExcel Object **/ - $objReader->loadIntoExisting($inputFileName, $objPHPExcel); + $objReader->loadIntoExisting($inputFileName, $spreadsheet); /* Set the worksheet title (to reference the "sheet" of data that we've loaded) **/ /* and increment the sheet index as well **/ - $objPHPExcel->getActiveSheet()->setTitle('Country Data #' . (++$sheet)); + $spreadsheet->getActiveSheet()->setTitle('Country Data #' . (++$sheet)); } echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo 'Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'
'; - $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, false, false, true); + $spreadsheet->setActiveSheetIndexByName($loadedSheetName); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true); var_dump($sheetData); echo '
'; } diff --git a/docs/Examples/Reader/exampleReader15.php b/docs/Examples/Reader/exampleReader15.php index 21fef9dc..59256015 100644 --- a/docs/Examples/Reader/exampleReader15.php +++ b/docs/Examples/Reader/exampleReader15.php @@ -17,28 +17,28 @@ /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; -PHPExcel_Cell::setValueBinder(new PHPExcel_Cell_AdvancedValueBinder()); +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder()); $inputFileType = 'CSV'; $inputFileName = './sampleData/example1.tsv'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'
'; $objReader->setDelimiter("\t"); -$objPHPExcel = $objReader->load($inputFileName); -$objPHPExcel->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); +$spreadsheet = $objReader->load($inputFileName); +$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); echo '
'; -echo $objPHPExcel->getSheetCount(),' worksheet',(($objPHPExcel->getSheetCount() == 1) ? '' : 's'),' loaded

'; -$loadedSheetNames = $objPHPExcel->getSheetNames(); +echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded

'; +$loadedSheetNames = $spreadsheet->getSheetNames(); foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo 'Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)
'; - $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); + $spreadsheet->setActiveSheetIndexByName($loadedSheetName); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); echo '
'; } @@ -47,8 +47,8 @@ echo '
'; foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo 'Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Unformatted)
'; - $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, false, true); + $spreadsheet->setActiveSheetIndexByName($loadedSheetName); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, false, true); var_dump($sheetData); echo '
'; } @@ -57,8 +57,8 @@ echo '
'; foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { echo 'Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Raw)
'; - $objPHPExcel->setActiveSheetIndexByName($loadedSheetName); - $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, false, false, true); + $spreadsheet->setActiveSheetIndexByName($loadedSheetName); + $sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true); var_dump($sheetData); echo '
'; } diff --git a/docs/Examples/Reader/exampleReader16.php b/docs/Examples/Reader/exampleReader16.php index bfc04a94..a9a8c856 100644 --- a/docs/Examples/Reader/exampleReader16.php +++ b/docs/Examples/Reader/exampleReader16.php @@ -22,20 +22,20 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileName = './sampleData/example_1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format
'; try { - $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); } catch (\PHPExcel\Reader\Exception $e) { die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); } echo '
'; -$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true); +$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); var_dump($sheetData); ?> diff --git a/docs/Examples/Reader/exampleReader17.php b/docs/Examples/Reader/exampleReader17.php index 1ac0e873..9064847a 100644 --- a/docs/Examples/Reader/exampleReader17.php +++ b/docs/Examples/Reader/exampleReader17.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -33,7 +33,7 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /* Read the list of Worksheet Names from the Workbook file **/ echo 'Read the list of Worksheets in the WorkBook
'; diff --git a/docs/Examples/Reader/exampleReader18.php b/docs/Examples/Reader/exampleReader18.php index 8e88d39f..379ffe5d 100644 --- a/docs/Examples/Reader/exampleReader18.php +++ b/docs/Examples/Reader/exampleReader18.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -34,7 +34,7 @@ $inputFileName = './sampleData/example1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' information using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetNames = $objReader->listWorksheetNames($inputFileName); echo '

Worksheet Names

'; diff --git a/docs/Examples/Reader/exampleReader19.php b/docs/Examples/Reader/exampleReader19.php index e8bfb4dd..1cb53fe0 100644 --- a/docs/Examples/Reader/exampleReader19.php +++ b/docs/Examples/Reader/exampleReader19.php @@ -22,7 +22,7 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; @@ -34,7 +34,7 @@ $inputFileName = './sampleData/example1.xls'; echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' information using IOFactory with a defined reader type of ',$inputFileType,'
'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetData = $objReader->listWorksheetInfo($inputFileName); echo '

Worksheet Information

'; diff --git a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader01.php b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader01.php index 2ecc635a..4520240d 100644 --- a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader01.php +++ b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader01.php @@ -22,67 +22,67 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /* Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; /* Read the document's creator property **/ -$creator = $objPHPExcel->getProperties()->getCreator(); +$creator = $spreadsheet->getProperties()->getCreator(); echo 'Document Creator: ',$creator,'
'; /* Read the Date when the workbook was created (as a PHP timestamp value) **/ -$creationDatestamp = $objPHPExcel->getProperties()->getCreated(); +$creationDatestamp = $spreadsheet->getProperties()->getCreated(); /* Format the date and time using the standard PHP date() function **/ $creationDate = date('l, d<\s\up>S F Y', $creationDatestamp); $creationTime = date('g:i A', $creationDatestamp); echo 'Created On: ',$creationDate,' at ',$creationTime,'
'; /* Read the name of the last person to modify this workbook **/ -$modifiedBy = $objPHPExcel->getProperties()->getLastModifiedBy(); +$modifiedBy = $spreadsheet->getProperties()->getLastModifiedBy(); echo 'Last Modified By: ',$modifiedBy,'
'; /* Read the Date when the workbook was last modified (as a PHP timestamp value) **/ -$modifiedDatestamp = $objPHPExcel->getProperties()->getModified(); +$modifiedDatestamp = $spreadsheet->getProperties()->getModified(); /* Format the date and time using the standard PHP date() function **/ $modifiedDate = date('l, d<\s\up>S F Y', $modifiedDatestamp); $modifiedTime = date('g:i A', $modifiedDatestamp); echo 'Last Modified On: ',$modifiedDate,' at ',$modifiedTime,'
'; /* Read the workbook title property **/ -$workbookTitle = $objPHPExcel->getProperties()->getTitle(); +$workbookTitle = $spreadsheet->getProperties()->getTitle(); echo 'Title: ',$workbookTitle,'
'; /* Read the workbook description property **/ -$description = $objPHPExcel->getProperties()->getDescription(); +$description = $spreadsheet->getProperties()->getDescription(); echo 'Description: ',$description,'
'; /* Read the workbook subject property **/ -$subject = $objPHPExcel->getProperties()->getSubject(); +$subject = $spreadsheet->getProperties()->getSubject(); echo 'Subject: ',$subject,'
'; /* Read the workbook keywords property **/ -$keywords = $objPHPExcel->getProperties()->getKeywords(); +$keywords = $spreadsheet->getProperties()->getKeywords(); echo 'Keywords: ',$keywords,'
'; /* Read the workbook category property **/ -$category = $objPHPExcel->getProperties()->getCategory(); +$category = $spreadsheet->getProperties()->getCategory(); echo 'Category: ',$category,'
'; /* Read the workbook company property **/ -$company = $objPHPExcel->getProperties()->getCompany(); +$company = $spreadsheet->getProperties()->getCompany(); echo 'Company: ',$company,'
'; /* Read the workbook manager property **/ -$manager = $objPHPExcel->getProperties()->getManager(); +$manager = $spreadsheet->getProperties()->getManager(); echo 'Manager: ',$manager,'
'; ?> diff --git a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader02.php b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader02.php index 55e7594d..6ce58bc6 100644 --- a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader02.php +++ b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader02.php @@ -22,21 +22,21 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xlsx'; $inputFileName = './sampleData/example1.xlsx'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /* Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; /* Read an array list of any custom properties for this document **/ -$customPropertyList = $objPHPExcel->getProperties()->getCustomProperties(); +$customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); echo 'Custom Property names:
'; foreach ($customPropertyList as $customPropertyName) { diff --git a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader03.php b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader03.php index 3d1e8348..a0ff81b6 100644 --- a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader03.php +++ b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader03.php @@ -22,30 +22,30 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xlsx'; $inputFileName = './sampleData/example1.xlsx'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /* Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; /* Read an array list of any custom properties for this document **/ -$customPropertyList = $objPHPExcel->getProperties()->getCustomProperties(); +$customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); echo 'Custom Properties:
'; /* Loop through the list of custom properties **/ foreach ($customPropertyList as $customPropertyName) { echo '',$customPropertyName,': '; /* Retrieve the property value **/ - $propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customPropertyName); + $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customPropertyName); /* Retrieve the property type **/ - $propertyType = $objPHPExcel->getProperties()->getCustomPropertyType($customPropertyName); + $propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customPropertyName); /* Manipulate properties as appropriate for display purposes **/ switch ($propertyType) { diff --git a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader04.php b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader04.php index 063d5768..4de32253 100644 --- a/docs/Examples/Reading WorkBook Data/exampleWorkBookReader04.php +++ b/docs/Examples/Reading WorkBook Data/exampleWorkBookReader04.php @@ -22,27 +22,27 @@ date_default_timezone_set('Europe/London'); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); -/** PHPExcel_IOFactory */ +/** \PhpOffice\PhpSpreadsheet\IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileType = 'Xls'; $inputFileName = './sampleData/example2.xls'; /* Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /* Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); echo '
'; echo 'Reading the number of Worksheets in the WorkBook
'; /* Use the PHPExcel object's getSheetCount() method to get a count of the number of WorkSheets in the WorkBook */ -$sheetCount = $objPHPExcel->getSheetCount(); +$sheetCount = $spreadsheet->getSheetCount(); echo 'There ',(($sheetCount == 1) ? 'is' : 'are'),' ',$sheetCount,' WorkSheet',(($sheetCount == 1) ? '' : 's'),' in the WorkBook

'; echo 'Reading the names of Worksheets in the WorkBook
'; /* Use the PHPExcel object's getSheetNames() method to get an array listing the names/titles of the WorkSheets in the WorkBook */ -$sheetNames = $objPHPExcel->getSheetNames(); +$sheetNames = $spreadsheet->getSheetNames(); foreach ($sheetNames as $sheetIndex => $sheetName) { echo 'WorkSheet #',$sheetIndex,' is named "',$sheetName,'"
'; } diff --git a/docs/Features/Autofilters/01-Autofilters.md b/docs/Features/Autofilters/01-Autofilters.md index 8dd77df2..37cbe858 100644 --- a/docs/Features/Autofilters/01-Autofilters.md +++ b/docs/Features/Autofilters/01-Autofilters.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## AutoFilters @@ -7,7 +7,7 @@ Each worksheet in an Excel Workbook can contain a single autoFilter range. Filte ![01-01-autofilter.png](./images/01-01-autofilter.png "") -When an AutoFilter is applied to a range of cells, the first row in an autofilter range will be the heading row, which displays the autoFilter dropdown icons. It is not part of the actual autoFiltered data. All subsequent rows are the autoFiltered data. So an AutoFilter range should always contain the heading row and one or more data rows (one data row is pretty meaningless), but PHPExcel won't actually stop you specifying a meaningless range: it's up to you as a developer to avoid such errors. +When an AutoFilter is applied to a range of cells, the first row in an autofilter range will be the heading row, which displays the autoFilter dropdown icons. It is not part of the actual autoFiltered data. All subsequent rows are the autoFiltered data. So an AutoFilter range should always contain the heading row and one or more data rows (one data row is pretty meaningless), but PhpSpreadsheet won't actually stop you specifying a meaningless range: it's up to you as a developer to avoid such errors. To determine if a filter is applied, note the icon in the column heading. A drop-down arrow (![01-03-filter-icon-1.png](./images/01-03-filter-icon-1.png "")) means that filtering is enabled but not applied. In MS Excel, when you hover over the heading of a column with filtering enabled but not applied, a screen tip displays the cell text for the first row in that column, and the message "(Showing All)". diff --git a/docs/Features/Autofilters/02-Setting-an-Autofilter.md b/docs/Features/Autofilters/02-Setting-an-Autofilter.md index 592d887f..b19939a4 100644 --- a/docs/Features/Autofilters/02-Setting-an-Autofilter.md +++ b/docs/Features/Autofilters/02-Setting-an-Autofilter.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Setting an AutoFilter area on a worksheet @@ -6,16 +6,16 @@ To set an autoFilter on a range of cells. ```php -$objPHPExcel->getActiveSheet()->setAutoFilter('A1:E20'); +$spreadsheet->getActiveSheet()->setAutoFilter('A1:E20'); ``` -The first row in an autofilter range will be the heading row, which displays the autoFilter dropdown icons. It is not part of the actual autoFiltered data. All subsequent rows are the autoFiltered data. So an AutoFilter range should always contain the heading row and one or more data rows (one data row is pretty meaningless, but PHPExcel won't actually stop you specifying a meaningless range: it's up to you as a developer to avoid such errors. +The first row in an autofilter range will be the heading row, which displays the autoFilter dropdown icons. It is not part of the actual autoFiltered data. All subsequent rows are the autoFiltered data. So an AutoFilter range should always contain the heading row and one or more data rows (one data row is pretty meaningless, but PhpSpreadsheet won't actually stop you specifying a meaningless range: it's up to you as a developer to avoid such errors. If you want to set the whole worksheet as an autofilter region ```php -$objPHPExcel->getActiveSheet()->setAutoFilter( - $objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet()->setAutoFilter( + $spreadsheet->getActiveSheet() ->calculateWorksheetDimension() ); ``` diff --git a/docs/Features/Autofilters/03-Autofilter-Expressions.md b/docs/Features/Autofilters/03-Autofilter-Expressions.md index e03f622d..4297f55a 100644 --- a/docs/Features/Autofilters/03-Autofilter-Expressions.md +++ b/docs/Features/Autofilters/03-Autofilter-Expressions.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -8,7 +8,7 @@ PHPEXcel 1.7.8 introduced the ability to actually create, read and write filter To apply a filter expression to an autoFilter range, you first need to identify which column you're going to be applying this filter to. ```php -$autoFilter = $objPHPExcel->getActiveSheet()->getAutoFilter(); +$autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter(); $columnFilter = $autoFilter->getColumn('C'); ``` @@ -22,6 +22,6 @@ There are a number of different types of autofilter expressions. The most common - Dynamic Filters - Top Ten Filters -These different types are mutually exclusive within any single column. You should not mix the different types of filter in the same column. PHPExcel will not actively prevent you from doing this, but the results are unpredictable. +These different types are mutually exclusive within any single column. You should not mix the different types of filter in the same column. PhpSpreadsheet will not actively prevent you from doing this, but the results are unpredictable. Other filter expression types (such as cell colour filters) are not yet supported. diff --git a/docs/Features/Autofilters/04-01-Autofilter-Expressions-Simple.md b/docs/Features/Autofilters/04-01-Autofilter-Expressions-Simple.md index ca229b89..675f1ee4 100644 --- a/docs/Features/Autofilters/04-01-Autofilter-Expressions-Simple.md +++ b/docs/Features/Autofilters/04-01-Autofilter-Expressions-Simple.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -13,24 +13,24 @@ To create a filter expression, we need to start by identifying the filter type. ```php $columnFilter->setFilterType( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER ); ``` Now we've identified the filter type, we can create a filter rule and set the filter values: -When creating a simple filter in PHPExcel, you only need to specify the values for "checked" columns: you do this by creating a filter rule for each value. +When creating a simple filter in PhpSpreadsheet, you only need to specify the values for "checked" columns: you do this by creating a filter rule for each value. ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'France' ); $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'Germany' ); ``` @@ -46,7 +46,7 @@ If you want to create a filter to select blank cells, you would use: ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, '' ); ``` diff --git a/docs/Features/Autofilters/04-02-Autofilter-Expressions-Dategroup.md b/docs/Features/Autofilters/04-02-Autofilter-Expressions-Dategroup.md index 2b9015ff..453a3dd4 100644 --- a/docs/Features/Autofilters/04-02-Autofilter-Expressions-Dategroup.md +++ b/docs/Features/Autofilters/04-02-Autofilter-Expressions-Dategroup.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -13,23 +13,23 @@ DateGroup filters are still applied as a Standard Filter type. ```php $columnFilter->setFilterType( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER ); ``` -Creating a dateGroup filter in PHPExcel, you specify the values for "checked" columns as an associative array of year. month, day, hour minute and second. To select a year and month, you need to create a DateGroup rule identifying the selected year and month: +Creating a dateGroup filter in PhpSpreadsheet, you specify the values for "checked" columns as an associative array of year. month, day, hour minute and second. To select a year and month, you need to create a DateGroup rule identifying the selected year and month: ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, array( 'year' => 2012, 'month' => 1 ) ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP ); ``` diff --git a/docs/Features/Autofilters/04-03-Autofilter-Expressions-Custom.md b/docs/Features/Autofilters/04-03-Autofilter-Expressions-Custom.md index 9ca3bd49..1d39cdab 100644 --- a/docs/Features/Autofilters/04-03-Autofilter-Expressions-Custom.md +++ b/docs/Features/Autofilters/04-03-Autofilter-Expressions-Custom.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -17,7 +17,7 @@ We start by specifying a Filter type, this time a CUSTOMFILTER. ```php $columnFilter->setFilterType( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER ); ``` @@ -28,11 +28,11 @@ The following shows a simple wildcard filter to show all column entries beginnin ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'U*' ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER ); ``` @@ -45,19 +45,19 @@ To create a "between" condition, we need to define two rules: ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, -20 ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER ); $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL, 20 ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER ); ``` @@ -67,11 +67,11 @@ This defined two rules, filtering numbers that are >= -20 OR <= 20, so we also n ```php $columnFilter->setAndOr( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_ANDOR_AND + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_ANDOR_AND ); ``` -The valid set of operators for Custom Filters are defined in the PHPExcel_Worksheet_AutoFilter_Column_Rule class, and comprise: +The valid set of operators for Custom Filters are defined in the \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and comprise: Operator Constant | Value | ------------------------------------------|----------------------| diff --git a/docs/Features/Autofilters/04-04-Autofilter-Expressions-Dynamic.md b/docs/Features/Autofilters/04-04-Autofilter-Expressions-Dynamic.md index f285e573..bcd0c33a 100644 --- a/docs/Features/Autofilters/04-04-Autofilter-Expressions-Dynamic.md +++ b/docs/Features/Autofilters/04-04-Autofilter-Expressions-Dynamic.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -13,7 +13,7 @@ Again, we start by specifying a Filter type, this time a DYNAMICFILTER. ```php $columnFilter->setFilterType( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER ); ``` @@ -22,18 +22,18 @@ When defining the rule for a dynamic filter, we don't define a value (we can sim ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, NULL, - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER ); ``` We also set the rule type to DYNAMICFILTER. -The valid set of dynamic filter categories is defined in the PHPExcel_Worksheet_AutoFilter_Column_Rule class, and comprises: +The valid set of dynamic filter categories is defined in the \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and comprises: Operator Constant | Value | -----------------------------------------|----------------| diff --git a/docs/Features/Autofilters/04-05-Autofilter-Expressions-Topten.md b/docs/Features/Autofilters/04-05-Autofilter-Expressions-Topten.md index ff36b0a8..8dc787d6 100644 --- a/docs/Features/Autofilters/04-05-Autofilter-Expressions-Topten.md +++ b/docs/Features/Autofilters/04-05-Autofilter-Expressions-Topten.md @@ -1,4 +1,4 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Autofilter Expressions @@ -19,7 +19,7 @@ We start by specifying a Filter type, this time a DYNAMICFILTER. ```php $columnFilter->setFilterType( - PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER ); ``` @@ -28,12 +28,12 @@ Then we create the rule: ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT, 5, - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER ); ``` @@ -44,16 +44,16 @@ To specify the lowest (bottom 2 values), we would specify a rule of: ```php $columnFilter->createRule() ->setRule( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE, 5, - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM ) ->setRuleType( - PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER ); ``` -The option values for TopTen Filters top/bottom value/percent are all defined in the PHPExcel_Worksheet_AutoFilter_Column_Rule class, and comprise: +The option values for TopTen Filters top/bottom value/percent are all defined in the \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and comprise: Operator Constant | Value | ---------------------------------------|-------------| diff --git a/docs/Features/Autofilters/05-Executing-Autofilters.md b/docs/Features/Autofilters/05-Executing-Autofilters.md index 852e1f41..522e6e90 100644 --- a/docs/Features/Autofilters/05-Executing-Autofilters.md +++ b/docs/Features/Autofilters/05-Executing-Autofilters.md @@ -1,18 +1,18 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## Executing an AutoFilter When an autofilter is applied in MS Excel, it sets the row hidden/visible flags for each row of the autofilter area based on the selected criteria, so that only those rows that match the filter criteria are displayed. -PHPExcel will not execute the equivalent function automatically when you set or change a filter expression, but only when the file is saved. +PhpSpreadsheet will not execute the equivalent function automatically when you set or change a filter expression, but only when the file is saved. ### Applying the Filter If you wish to execute your filter from within a script, you need to do this manually. You can do this using the autofilters showHideRows() method. ```php -$autoFilter = $objPHPExcel->getActiveSheet()->getAutoFilter(); +$autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter(); $autoFilter->showHideRows(); ``` @@ -23,16 +23,16 @@ This will set all rows that match the filter criteria to visible, while hiding a Simply looping through the rows in an autofilter area will still access ever row, whether it matches the filter criteria or not. To selectively access only the filtered rows, you need to test each row’s visibility settings. ```php -foreach ($objPHPExcel->getActiveSheet()->getRowIterator() as $row) { - if ($objPHPExcel->getActiveSheet() +foreach ($spreadsheet->getActiveSheet()->getRowIterator() as $row) { + if ($spreadsheet->getActiveSheet() ->getRowDimension($row->getRowIndex())->getVisible()) { echo ' Row number - ' , $row->getRowIndex() , ' '; - echo $objPHPExcel->getActiveSheet() + echo $spreadsheet->getActiveSheet() ->getCell( 'C'.$row->getRowIndex() ) ->getValue(), ' '; - echo $objPHPExcel->getActiveSheet() + echo $spreadsheet->getActiveSheet() ->getCell( 'D'.$row->getRowIndex() )->getFormattedValue(), ' '; diff --git a/docs/Features/Autofilters/06-Autofilter-Sorting.md b/docs/Features/Autofilters/06-Autofilter-Sorting.md index 23133b8f..b19c07ab 100644 --- a/docs/Features/Autofilters/06-Autofilter-Sorting.md +++ b/docs/Features/Autofilters/06-Autofilter-Sorting.md @@ -1,7 +1,7 @@ -# PHPExcel AutoFilter Reference +# PhpSpreadsheet AutoFilter Reference ## AutoFilter Sorting -In MS Excel, Autofiltering also allows the rows to be sorted. This feature is ***not*** supported by PHPExcel. +In MS Excel, Autofiltering also allows the rows to be sorted. This feature is ***not*** supported by PhpSpreadsheet. diff --git a/docs/Functions/FunctionListByCategory.md b/docs/Functions/FunctionListByCategory.md index c19400cd..68a5dba3 100644 --- a/docs/Functions/FunctionListByCategory.md +++ b/docs/Functions/FunctionListByCategory.md @@ -1,6 +1,6 @@ ## CATEGORY_CUBE - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- CUBEKPIMEMBER | **\*\*\* Not yet Implemented** CUBEMEMBER | **\*\*\* Not yet Implemented** @@ -12,211 +12,211 @@ ## CATEGORY_DATABASE - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - DAVERAGE | PHPExcel_Calculation_Database::DAVERAGE - DCOUNT | PHPExcel_Calculation_Database::DCOUNT - DCOUNTA | PHPExcel_Calculation_Database::DCOUNTA - DGET | PHPExcel_Calculation_Database::DGET - DMAX | PHPExcel_Calculation_Database::DMAX - DMIN | PHPExcel_Calculation_Database::DMIN - DPRODUCT | PHPExcel_Calculation_Database::DPRODUCT - DSTDEV | PHPExcel_Calculation_Database::DSTDEV - DSTDEVP | PHPExcel_Calculation_Database::DSTDEVP - DSUM | PHPExcel_Calculation_Database::DSUM - DVAR | PHPExcel_Calculation_Database::DVAR - DVARP | PHPExcel_Calculation_Database::DVARP + DAVERAGE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DAVERAGE + DCOUNT | \PhpOffice\PhpSpreadsheet\Calculation\Database::DCOUNT + DCOUNTA | \PhpOffice\PhpSpreadsheet\Calculation\Database::DCOUNTA + DGET | \PhpOffice\PhpSpreadsheet\Calculation\Database::DGET + DMAX | \PhpOffice\PhpSpreadsheet\Calculation\Database::DMAX + DMIN | \PhpOffice\PhpSpreadsheet\Calculation\Database::DMIN + DPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\Database::DPRODUCT + DSTDEV | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSTDEV + DSTDEVP | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSTDEVP + DSUM | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSUM + DVAR | \PhpOffice\PhpSpreadsheet\Calculation\Database::DVAR + DVARP | \PhpOffice\PhpSpreadsheet\Calculation\Database::DVARP ## CATEGORY_DATE_AND_TIME - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - DATE | PHPExcel_Calculation_DateTime::DATE - DATEDIF | PHPExcel_Calculation_DateTime::DATEDIF - DATEVALUE | PHPExcel_Calculation_DateTime::DATEVALUE - DAY | PHPExcel_Calculation_DateTime::DAYOFMONTH - DAYS360 | PHPExcel_Calculation_DateTime::DAYS360 - EDATE | PHPExcel_Calculation_DateTime::EDATE - EOMONTH | PHPExcel_Calculation_DateTime::EOMONTH - HOUR | PHPExcel_Calculation_DateTime::HOUROFDAY - MINUTE | PHPExcel_Calculation_DateTime::MINUTE - MONTH | PHPExcel_Calculation_DateTime::MONTHOFYEAR - NETWORKDAYS | PHPExcel_Calculation_DateTime::NETWORKDAYS - NOW | PHPExcel_Calculation_DateTime::DATETIMENOW - SECOND | PHPExcel_Calculation_DateTime::SECOND - TIME | PHPExcel_Calculation_DateTime::TIME - TIMEVALUE | PHPExcel_Calculation_DateTime::TIMEVALUE - TODAY | PHPExcel_Calculation_DateTime::DATENOW - WEEKDAY | PHPExcel_Calculation_DateTime::WEEKDAY - WEEKNUM | PHPExcel_Calculation_DateTime::WEEKNUM - WORKDAY | PHPExcel_Calculation_DateTime::WORKDAY - YEAR | PHPExcel_Calculation_DateTime::YEAR - YEARFRAC | PHPExcel_Calculation_DateTime::YEARFRAC + DATE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATE + DATEDIF | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATEDIF + DATEVALUE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATEVALUE + DAY | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYOFMONTH + DAYS360 | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYS360 + EDATE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EDATE + EOMONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH + HOUR | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::HOUROFDAY + MINUTE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE + MONTH | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MONTHOFYEAR + NETWORKDAYS | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::NETWORKDAYS + NOW | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATETIMENOW + SECOND | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::SECOND + TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIME + TIMEVALUE | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE + TODAY | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATENOW + WEEKDAY | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKDAY + WEEKNUM | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKNUM + WORKDAY | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WORKDAY + YEAR | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::YEAR + YEARFRAC | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::YEARFRAC ## CATEGORY_ENGINEERING - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - BESSELI | PHPExcel_Calculation_Engineering::BESSELI - BESSELJ | PHPExcel_Calculation_Engineering::BESSELJ - BESSELK | PHPExcel_Calculation_Engineering::BESSELK - BESSELY | PHPExcel_Calculation_Engineering::BESSELY - BIN2DEC | PHPExcel_Calculation_Engineering::BINTODEC - BIN2HEX | PHPExcel_Calculation_Engineering::BINTOHEX - BIN2OCT | PHPExcel_Calculation_Engineering::BINTOOCT - COMPLEX | PHPExcel_Calculation_Engineering::COMPLEX - CONVERT | PHPExcel_Calculation_Engineering::CONVERTUOM - DEC2BIN | PHPExcel_Calculation_Engineering::DECTOBIN - DEC2HEX | PHPExcel_Calculation_Engineering::DECTOHEX - DEC2OCT | PHPExcel_Calculation_Engineering::DECTOOCT - DELTA | PHPExcel_Calculation_Engineering::DELTA - ERF | PHPExcel_Calculation_Engineering::ERF - ERFC | PHPExcel_Calculation_Engineering::ERFC - GESTEP | PHPExcel_Calculation_Engineering::GESTEP - HEX2BIN | PHPExcel_Calculation_Engineering::HEXTOBIN - HEX2DEC | PHPExcel_Calculation_Engineering::HEXTODEC - HEX2OCT | PHPExcel_Calculation_Engineering::HEXTOOCT - IMABS | PHPExcel_Calculation_Engineering::IMABS - IMAGINARY | PHPExcel_Calculation_Engineering::IMAGINARY - IMARGUMENT | PHPExcel_Calculation_Engineering::IMARGUMENT - IMCONJUGATE | PHPExcel_Calculation_Engineering::IMCONJUGATE - IMCOS | PHPExcel_Calculation_Engineering::IMCOS - IMDIV | PHPExcel_Calculation_Engineering::IMDIV - IMEXP | PHPExcel_Calculation_Engineering::IMEXP - IMLN | PHPExcel_Calculation_Engineering::IMLN - IMLOG10 | PHPExcel_Calculation_Engineering::IMLOG10 - IMLOG2 | PHPExcel_Calculation_Engineering::IMLOG2 - IMPOWER | PHPExcel_Calculation_Engineering::IMPOWER - IMPRODUCT | PHPExcel_Calculation_Engineering::IMPRODUCT - IMREAL | PHPExcel_Calculation_Engineering::IMREAL - IMSIN | PHPExcel_Calculation_Engineering::IMSIN - IMSQRT | PHPExcel_Calculation_Engineering::IMSQRT - IMSUB | PHPExcel_Calculation_Engineering::IMSUB - IMSUM | PHPExcel_Calculation_Engineering::IMSUM - OCT2BIN | PHPExcel_Calculation_Engineering::OCTTOBIN - OCT2DEC | PHPExcel_Calculation_Engineering::OCTTODEC - OCT2HEX | PHPExcel_Calculation_Engineering::OCTTOHEX + BESSELI | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELI + BESSELJ | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELJ + BESSELK | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELK + BESSELY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELY + BIN2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTODEC + BIN2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOHEX + BIN2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOOCT + COMPLEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::COMPLEX + CONVERT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::CONVERTUOM + DEC2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOBIN + DEC2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOHEX + DEC2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOOCT + DELTA | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DELTA + ERF | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF + ERFC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC + GESTEP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::GESTEP + HEX2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOBIN + HEX2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTODEC + HEX2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOOCT + IMABS | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMABS + IMAGINARY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMAGINARY + IMARGUMENT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT + IMCONJUGATE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE + IMCOS | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS + IMDIV | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV + IMEXP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP + IMLN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN + IMLOG10 | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG10 + IMLOG2 | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG2 + IMPOWER | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER + IMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT + IMREAL | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL + IMSIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN + IMSQRT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT + IMSUB | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB + IMSUM | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM + OCT2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOBIN + OCT2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTODEC + OCT2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOHEX ## CATEGORY_FINANCIAL - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - ACCRINT | PHPExcel_Calculation_Financial::ACCRINT - ACCRINTM | PHPExcel_Calculation_Financial::ACCRINTM - AMORDEGRC | PHPExcel_Calculation_Financial::AMORDEGRC - AMORLINC | PHPExcel_Calculation_Financial::AMORLINC - COUPDAYBS | PHPExcel_Calculation_Financial::COUPDAYBS - COUPDAYS | PHPExcel_Calculation_Financial::COUPDAYS - COUPDAYSNC | PHPExcel_Calculation_Financial::COUPDAYSNC - COUPNCD | PHPExcel_Calculation_Financial::COUPNCD - COUPNUM | PHPExcel_Calculation_Financial::COUPNUM - COUPPCD | PHPExcel_Calculation_Financial::COUPPCD - CUMIPMT | PHPExcel_Calculation_Financial::CUMIPMT - CUMPRINC | PHPExcel_Calculation_Financial::CUMPRINC - DB | PHPExcel_Calculation_Financial::DB - DDB | PHPExcel_Calculation_Financial::DDB - DISC | PHPExcel_Calculation_Financial::DISC - DOLLARDE | PHPExcel_Calculation_Financial::DOLLARDE - DOLLARFR | PHPExcel_Calculation_Financial::DOLLARFR + ACCRINT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ACCRINT + ACCRINTM | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ACCRINTM + AMORDEGRC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORDEGRC + AMORLINC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORLINC + COUPDAYBS | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYBS + COUPDAYS | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYS + COUPDAYSNC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYSNC + COUPNCD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPNCD + COUPNUM | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPNUM + COUPPCD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPPCD + CUMIPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::CUMIPMT + CUMPRINC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::CUMPRINC + DB | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DB + DDB | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DDB + DISC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DISC + DOLLARDE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DOLLARDE + DOLLARFR | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DOLLARFR DURATION | **\*\*\* Not yet Implemented** - EFFECT | PHPExcel_Calculation_Financial::EFFECT - FV | PHPExcel_Calculation_Financial::FV - FVSCHEDULE | PHPExcel_Calculation_Financial::FVSCHEDULE - INTRATE | PHPExcel_Calculation_Financial::INTRATE - IPMT | PHPExcel_Calculation_Financial::IPMT - IRR | PHPExcel_Calculation_Financial::IRR - ISPMT | PHPExcel_Calculation_Financial::ISPMT + EFFECT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::EFFECT + FV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::FV + FVSCHEDULE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::FVSCHEDULE + INTRATE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::INTRATE + IPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IPMT + IRR | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IRR + ISPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ISPMT MDURATION | **\*\*\* Not yet Implemented** - MIRR | PHPExcel_Calculation_Financial::MIRR - NOMINAL | PHPExcel_Calculation_Financial::NOMINAL - NPER | PHPExcel_Calculation_Financial::NPER - NPV | PHPExcel_Calculation_Financial::NPV + MIRR | \PhpOffice\PhpSpreadsheet\Calculation\Financial::MIRR + NOMINAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NOMINAL + NPER | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPER + NPV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPV ODDFPRICE | **\*\*\* Not yet Implemented** ODDFYIELD | **\*\*\* Not yet Implemented** ODDLPRICE | **\*\*\* Not yet Implemented** ODDLYIELD | **\*\*\* Not yet Implemented** - PMT | PHPExcel_Calculation_Financial::PMT - PPMT | PHPExcel_Calculation_Financial::PPMT - PRICE | PHPExcel_Calculation_Financial::PRICE - PRICEDISC | PHPExcel_Calculation_Financial::PRICEDISC - PRICEMAT | PHPExcel_Calculation_Financial::PRICEMAT - PV | PHPExcel_Calculation_Financial::PV - RATE | PHPExcel_Calculation_Financial::RATE - RECEIVED | PHPExcel_Calculation_Financial::RECEIVED - SLN | PHPExcel_Calculation_Financial::SLN - SYD | PHPExcel_Calculation_Financial::SYD - TBILLEQ | PHPExcel_Calculation_Financial::TBILLEQ - TBILLPRICE | PHPExcel_Calculation_Financial::TBILLPRICE - TBILLYIELD | PHPExcel_Calculation_Financial::TBILLYIELD + PMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PMT + PPMT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PPMT + PRICE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICE + PRICEDISC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEDISC + PRICEMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEMAT + PV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PV + RATE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RATE + RECEIVED | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RECEIVED + SLN | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SLN + SYD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SYD + TBILLEQ | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLEQ + TBILLPRICE | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLPRICE + TBILLYIELD | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLYIELD USDOLLAR | **\*\*\* Not yet Implemented** VDB | **\*\*\* Not yet Implemented** - XIRR | PHPExcel_Calculation_Financial::XIRR - XNPV | PHPExcel_Calculation_Financial::XNPV + XIRR | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XIRR + XNPV | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XNPV YIELD | **\*\*\* Not yet Implemented** - YIELDDISC | PHPExcel_Calculation_Financial::YIELDDISC - YIELDMAT | PHPExcel_Calculation_Financial::YIELDMAT + YIELDDISC | \PhpOffice\PhpSpreadsheet\Calculation\Financial::YIELDDISC + YIELDMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::YIELDMAT ## CATEGORY_INFORMATION - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- CELL | **\*\*\* Not yet Implemented** - ERROR.TYPE | PHPExcel_Calculation_Functions::ERROR_TYPE + ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE INFO | **\*\*\* Not yet Implemented** - ISBLANK | PHPExcel_Calculation_Functions::IS_BLANK - ISERR | PHPExcel_Calculation_Functions::IS_ERR - ISERROR | PHPExcel_Calculation_Functions::IS_ERROR - ISEVEN | PHPExcel_Calculation_Functions::IS_EVEN - ISLOGICAL | PHPExcel_Calculation_Functions::IS_LOGICAL - ISNA | PHPExcel_Calculation_Functions::IS_NA - ISNONTEXT | PHPExcel_Calculation_Functions::IS_NONTEXT - ISNUMBER | PHPExcel_Calculation_Functions::IS_NUMBER - ISODD | PHPExcel_Calculation_Functions::IS_ODD + ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK + ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR + ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR + ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN + ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL + ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA + ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT + ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NUMBER + ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ODD ISREF | **\*\*\* Not yet Implemented** - ISTEXT | PHPExcel_Calculation_Functions::IS_TEXT - N | PHPExcel_Calculation_Functions::N - NA | PHPExcel_Calculation_Functions::NA - TYPE | PHPExcel_Calculation_Functions::TYPE - VERSION | PHPExcel_Calculation_Functions::VERSION + ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_TEXT + N | \PhpOffice\PhpSpreadsheet\Calculation\Functions::N + NA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::NA + TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE + VERSION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::VERSION ## CATEGORY_LOGICAL - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - AND | PHPExcel_Calculation_Logical::LOGICAL_AND - FALSE | PHPExcel_Calculation_Logical::FALSE - IF | PHPExcel_Calculation_Logical::STATEMENT_IF - IFERROR | PHPExcel_Calculation_Logical::IFERROR - NOT | PHPExcel_Calculation_Logical::NOT - OR | PHPExcel_Calculation_Logical::LOGICAL_OR - TRUE | PHPExcel_Calculation_Logical::TRUE + AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_AND + FALSE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE + IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF + IFERROR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR + NOT | \PhpOffice\PhpSpreadsheet\Calculation\Logical::NOT + OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_OR + TRUE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::TRUE ## CATEGORY_LOOKUP_AND_REFERENCE - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - ADDRESS | PHPExcel_Calculation_LookupRef::CELL_ADDRESS + ADDRESS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CELL_ADDRESS AREAS | **\*\*\* Not yet Implemented** - CHOOSE | PHPExcel_Calculation_LookupRef::CHOOSE - COLUMN | PHPExcel_Calculation_LookupRef::COLUMN - COLUMNS | PHPExcel_Calculation_LookupRef::COLUMNS + CHOOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CHOOSE + COLUMN | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMN + COLUMNS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMNS GETPIVOTDATA | **\*\*\* Not yet Implemented** HLOOKUP | **\*\*\* Not yet Implemented** - HYPERLINK | PHPExcel_Calculation_LookupRef::HYPERLINK - INDEX | PHPExcel_Calculation_LookupRef::INDEX - INDIRECT | PHPExcel_Calculation_LookupRef::INDIRECT - LOOKUP | PHPExcel_Calculation_LookupRef::LOOKUP - MATCH | PHPExcel_Calculation_LookupRef::MATCH - OFFSET | PHPExcel_Calculation_LookupRef::OFFSET - ROW | PHPExcel_Calculation_LookupRef::ROW - ROWS | PHPExcel_Calculation_LookupRef::ROWS + HYPERLINK | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HYPERLINK + INDEX | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX + INDIRECT | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT + LOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::LOOKUP + MATCH | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::MATCH + OFFSET | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::OFFSET + ROW | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROW + ROWS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROWS RTD | **\*\*\* Not yet Implemented** - TRANSPOSE | PHPExcel_Calculation_LookupRef::TRANSPOSE - VLOOKUP | PHPExcel_Calculation_LookupRef::VLOOKUP + TRANSPOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::TRANSPOSE + VLOOKUP | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::VLOOKUP ## CATEGORY_MATH_AND_TRIG - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- ABS | abs ACOS | acos @@ -224,188 +224,188 @@ ASIN | asin ASINH | asinh ATAN | atan - ATAN2 | PHPExcel_Calculation_MathTrig::REVERSE_ATAN2 + ATAN2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::REVERSE_ATAN2 ATANH | atanh - CEILING | PHPExcel_Calculation_MathTrig::CEILING - COMBIN | PHPExcel_Calculation_MathTrig::COMBIN + CEILING | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CEILING + COMBIN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN COS | cos COSH | cosh DEGREES | rad2deg - EVEN | PHPExcel_Calculation_MathTrig::EVEN + EVEN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN EXP | exp - FACT | PHPExcel_Calculation_MathTrig::FACT - FACTDOUBLE | PHPExcel_Calculation_MathTrig::FACTDOUBLE - FLOOR | PHPExcel_Calculation_MathTrig::FLOOR - GCD | PHPExcel_Calculation_MathTrig::GCD - INT | PHPExcel_Calculation_MathTrig::INT - LCM | PHPExcel_Calculation_MathTrig::LCM + FACT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACT + FACTDOUBLE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACTDOUBLE + FLOOR | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FLOOR + GCD | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::GCD + INT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::INT + LCM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LCM LN | log - LOG | PHPExcel_Calculation_MathTrig::LOG_BASE + LOG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LOG_BASE LOG10 | log10 - MDETERM | PHPExcel_Calculation_MathTrig::MDETERM - MINVERSE | PHPExcel_Calculation_MathTrig::MINVERSE - MMULT | PHPExcel_Calculation_MathTrig::MMULT - MOD | PHPExcel_Calculation_MathTrig::MOD - MROUND | PHPExcel_Calculation_MathTrig::MROUND - MULTINOMIAL | PHPExcel_Calculation_MathTrig::MULTINOMIAL - ODD | PHPExcel_Calculation_MathTrig::ODD + MDETERM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MDETERM + MINVERSE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MINVERSE + MMULT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MMULT + MOD | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MOD + MROUND | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MROUND + MULTINOMIAL | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MULTINOMIAL + ODD | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ODD PI | pi - POWER | PHPExcel_Calculation_MathTrig::POWER - PRODUCT | PHPExcel_Calculation_MathTrig::PRODUCT - QUOTIENT | PHPExcel_Calculation_MathTrig::QUOTIENT + POWER | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::POWER + PRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::PRODUCT + QUOTIENT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::QUOTIENT RADIANS | deg2rad - RAND | PHPExcel_Calculation_MathTrig::RAND - RANDBETWEEN | PHPExcel_Calculation_MathTrig::RAND - ROMAN | PHPExcel_Calculation_MathTrig::ROMAN + RAND | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::RAND + RANDBETWEEN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::RAND + ROMAN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROMAN ROUND | round - ROUNDDOWN | PHPExcel_Calculation_MathTrig::ROUNDDOWN - ROUNDUP | PHPExcel_Calculation_MathTrig::ROUNDUP - SERIESSUM | PHPExcel_Calculation_MathTrig::SERIESSUM - SIGN | PHPExcel_Calculation_MathTrig::SIGN + ROUNDDOWN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDDOWN + ROUNDUP | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDUP + SERIESSUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SERIESSUM + SIGN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SIGN SIN | sin SINH | sinh SQRT | sqrt - SQRTPI | PHPExcel_Calculation_MathTrig::SQRTPI - SUBTOTAL | PHPExcel_Calculation_MathTrig::SUBTOTAL - SUM | PHPExcel_Calculation_MathTrig::SUM - SUMIF | PHPExcel_Calculation_MathTrig::SUMIF + SQRTPI | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI + SUBTOTAL | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUBTOTAL + SUM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUM + SUMIF | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIF SUMIFS | **\*\*\* Not yet Implemented** - SUMPRODUCT | PHPExcel_Calculation_MathTrig::SUMPRODUCT - SUMSQ | PHPExcel_Calculation_MathTrig::SUMSQ - SUMX2MY2 | PHPExcel_Calculation_MathTrig::SUMX2MY2 - SUMX2PY2 | PHPExcel_Calculation_MathTrig::SUMX2PY2 - SUMXMY2 | PHPExcel_Calculation_MathTrig::SUMXMY2 + SUMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMPRODUCT + SUMSQ | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMSQ + SUMX2MY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2 + SUMX2PY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2PY2 + SUMXMY2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMXMY2 TAN | tan TANH | tanh - TRUNC | PHPExcel_Calculation_MathTrig::TRUNC + TRUNC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::TRUNC ## CATEGORY_STATISTICAL - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- - AVEDEV | PHPExcel_Calculation_Statistical::AVEDEV - AVERAGE | PHPExcel_Calculation_Statistical::AVERAGE - AVERAGEA | PHPExcel_Calculation_Statistical::AVERAGEA - AVERAGEIF | PHPExcel_Calculation_Statistical::AVERAGEIF + AVEDEV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVEDEV + AVERAGE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGE + AVERAGEA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGEA + AVERAGEIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGEIF AVERAGEIFS | **\*\*\* Not yet Implemented** - BETADIST | PHPExcel_Calculation_Statistical::BETADIST - BETAINV | PHPExcel_Calculation_Statistical::BETAINV - BINOMDIST | PHPExcel_Calculation_Statistical::BINOMDIST - CHIDIST | PHPExcel_Calculation_Statistical::CHIDIST - CHIINV | PHPExcel_Calculation_Statistical::CHIINV + BETADIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BETADIST + BETAINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BETAINV + BINOMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BINOMDIST + CHIDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CHIDIST + CHIINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CHIINV CHITEST | **\*\*\* Not yet Implemented** - CONFIDENCE | PHPExcel_Calculation_Statistical::CONFIDENCE - CORREL | PHPExcel_Calculation_Statistical::CORREL - COUNT | PHPExcel_Calculation_Statistical::COUNT - COUNTA | PHPExcel_Calculation_Statistical::COUNTA - COUNTBLANK | PHPExcel_Calculation_Statistical::COUNTBLANK - COUNTIF | PHPExcel_Calculation_Statistical::COUNTIF + CONFIDENCE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CONFIDENCE + CORREL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL + COUNT | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNT + COUNTA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTA + COUNTBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTBLANK + COUNTIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTIF COUNTIFS | **\*\*\* Not yet Implemented** - COVAR | PHPExcel_Calculation_Statistical::COVAR - CRITBINOM | PHPExcel_Calculation_Statistical::CRITBINOM - DEVSQ | PHPExcel_Calculation_Statistical::DEVSQ - EXPONDIST | PHPExcel_Calculation_Statistical::EXPONDIST + COVAR | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COVAR + CRITBINOM | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CRITBINOM + DEVSQ | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::DEVSQ + EXPONDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::EXPONDIST FDIST | **\*\*\* Not yet Implemented** FINV | **\*\*\* Not yet Implemented** - FISHER | PHPExcel_Calculation_Statistical::FISHER - FISHERINV | PHPExcel_Calculation_Statistical::FISHERINV - FORECAST | PHPExcel_Calculation_Statistical::FORECAST + FISHER | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHER + FISHERINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHERINV + FORECAST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FORECAST FREQUENCY | **\*\*\* Not yet Implemented** FTEST | **\*\*\* Not yet Implemented** - GAMMADIST | PHPExcel_Calculation_Statistical::GAMMADIST - GAMMAINV | PHPExcel_Calculation_Statistical::GAMMAINV - GAMMALN | PHPExcel_Calculation_Statistical::GAMMALN - GEOMEAN | PHPExcel_Calculation_Statistical::GEOMEAN - GROWTH | PHPExcel_Calculation_Statistical::GROWTH - HARMEAN | PHPExcel_Calculation_Statistical::HARMEAN - HYPGEOMDIST | PHPExcel_Calculation_Statistical::HYPGEOMDIST - INTERCEPT | PHPExcel_Calculation_Statistical::INTERCEPT - KURT | PHPExcel_Calculation_Statistical::KURT - LARGE | PHPExcel_Calculation_Statistical::LARGE - LINEST | PHPExcel_Calculation_Statistical::LINEST - LOGEST | PHPExcel_Calculation_Statistical::LOGEST - LOGINV | PHPExcel_Calculation_Statistical::LOGINV - LOGNORMDIST | PHPExcel_Calculation_Statistical::LOGNORMDIST - MAX | PHPExcel_Calculation_Statistical::MAX - MAXA | PHPExcel_Calculation_Statistical::MAXA - MAXIF | PHPExcel_Calculation_Statistical::MAXIF - MEDIAN | PHPExcel_Calculation_Statistical::MEDIAN + GAMMADIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMADIST + GAMMAINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMAINV + GAMMALN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMALN + GEOMEAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GEOMEAN + GROWTH | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GROWTH + HARMEAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::HARMEAN + HYPGEOMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::HYPGEOMDIST + INTERCEPT | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::INTERCEPT + KURT | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::KURT + LARGE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LARGE + LINEST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LINEST + LOGEST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGEST + LOGINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGINV + LOGNORMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGNORMDIST + MAX | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAX + MAXA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAXA + MAXIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAXIF + MEDIAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MEDIAN MEDIANIF | **\*\*\* Not yet Implemented** - MIN | PHPExcel_Calculation_Statistical::MIN - MINA | PHPExcel_Calculation_Statistical::MINA - MINIF | PHPExcel_Calculation_Statistical::MINIF - MODE | PHPExcel_Calculation_Statistical::MODE - NEGBINOMDIST | PHPExcel_Calculation_Statistical::NEGBINOMDIST - NORMDIST | PHPExcel_Calculation_Statistical::NORMDIST - NORMINV | PHPExcel_Calculation_Statistical::NORMINV - NORMSDIST | PHPExcel_Calculation_Statistical::NORMSDIST - NORMSINV | PHPExcel_Calculation_Statistical::NORMSINV - PEARSON | PHPExcel_Calculation_Statistical::CORREL - PERCENTILE | PHPExcel_Calculation_Statistical::PERCENTILE - PERCENTRANK | PHPExcel_Calculation_Statistical::PERCENTRANK - PERMUT | PHPExcel_Calculation_Statistical::PERMUT - POISSON | PHPExcel_Calculation_Statistical::POISSON + MIN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MIN + MINA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINA + MINIF | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINIF + MODE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE + NEGBINOMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NEGBINOMDIST + NORMDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMDIST + NORMINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMINV + NORMSDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMSDIST + NORMSINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMSINV + PEARSON | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL + PERCENTILE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTILE + PERCENTRANK | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTRANK + PERMUT | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERMUT + POISSON | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::POISSON PROB | **\*\*\* Not yet Implemented** - QUARTILE | PHPExcel_Calculation_Statistical::QUARTILE - RANK | PHPExcel_Calculation_Statistical::RANK - RSQ | PHPExcel_Calculation_Statistical::RSQ - SKEW | PHPExcel_Calculation_Statistical::SKEW - SLOPE | PHPExcel_Calculation_Statistical::SLOPE - SMALL | PHPExcel_Calculation_Statistical::SMALL - STANDARDIZE | PHPExcel_Calculation_Statistical::STANDARDIZE - STDEV | PHPExcel_Calculation_Statistical::STDEV - STDEVA | PHPExcel_Calculation_Statistical::STDEVA - STDEVP | PHPExcel_Calculation_Statistical::STDEVP - STDEVPA | PHPExcel_Calculation_Statistical::STDEVPA - STEYX | PHPExcel_Calculation_Statistical::STEYX - TDIST | PHPExcel_Calculation_Statistical::TDIST - TINV | PHPExcel_Calculation_Statistical::TINV - TREND | PHPExcel_Calculation_Statistical::TREND - TRIMMEAN | PHPExcel_Calculation_Statistical::TRIMMEAN + QUARTILE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::QUARTILE + RANK | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::RANK + RSQ | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::RSQ + SKEW | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SKEW + SLOPE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SLOPE + SMALL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SMALL + STANDARDIZE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE + STDEV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV + STDEVA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA + STDEVP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP + STDEVPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA + STEYX | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STEYX + TDIST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TDIST + TINV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TINV + TREND | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TREND + TRIMMEAN | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TRIMMEAN TTEST | **\*\*\* Not yet Implemented** - VAR | PHPExcel_Calculation_Statistical::VARFunc - VARA | PHPExcel_Calculation_Statistical::VARA - VARP | PHPExcel_Calculation_Statistical::VARP - VARPA | PHPExcel_Calculation_Statistical::VARPA - WEIBULL | PHPExcel_Calculation_Statistical::WEIBULL - ZTEST | PHPExcel_Calculation_Statistical::ZTEST + VAR | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc + VARA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARA + VARP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP + VARPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARPA + WEIBULL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::WEIBULL + ZTEST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::ZTEST ## CATEGORY_TEXT_AND_DATA - Excel Function | PHPExcel Function + Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- ASC | **\*\*\* Not yet Implemented** BAHTTEXT | **\*\*\* Not yet Implemented** - CHAR | PHPExcel_Calculation_TextData::CHARACTER - CLEAN | PHPExcel_Calculation_TextData::TRIMNONPRINTABLE - CODE | PHPExcel_Calculation_TextData::ASCIICODE - CONCATENATE | PHPExcel_Calculation_TextData::CONCATENATE - DOLLAR | PHPExcel_Calculation_TextData::DOLLAR + CHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER + CLEAN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMNONPRINTABLE + CODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE + CONCATENATE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE + DOLLAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData::DOLLAR EXACT | **\*\*\* Not yet Implemented** - FIND | PHPExcel_Calculation_TextData::SEARCHSENSITIVE - FINDB | PHPExcel_Calculation_TextData::SEARCHSENSITIVE - FIXED | PHPExcel_Calculation_TextData::FIXEDFORMAT + FIND | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE + FINDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE + FIXED | \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT JIS | **\*\*\* Not yet Implemented** - LEFT | PHPExcel_Calculation_TextData::LEFT - LEFTB | PHPExcel_Calculation_TextData::LEFT - LEN | PHPExcel_Calculation_TextData::STRINGLENGTH - LENB | PHPExcel_Calculation_TextData::STRINGLENGTH - LOWER | PHPExcel_Calculation_TextData::LOWERCASE - MID | PHPExcel_Calculation_TextData::MID - MIDB | PHPExcel_Calculation_TextData::MID + LEFT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LEFT + LEFTB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LEFT + LEN | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENGTH + LENB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENGTH + LOWER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LOWERCASE + MID | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID + MIDB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID PHONETIC | **\*\*\* Not yet Implemented** - PROPER | PHPExcel_Calculation_TextData::PROPERCASE - REPLACE | PHPExcel_Calculation_TextData::REPLACE - REPLACEB | PHPExcel_Calculation_TextData::REPLACE + PROPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::PROPERCASE + REPLACE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE + REPLACEB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE REPT | str_repeat - RIGHT | PHPExcel_Calculation_TextData::RIGHT - RIGHTB | PHPExcel_Calculation_TextData::RIGHT - SEARCH | PHPExcel_Calculation_TextData::SEARCHINSENSITIVE - SEARCHB | PHPExcel_Calculation_TextData::SEARCHINSENSITIVE - SUBSTITUTE | PHPExcel_Calculation_TextData::SUBSTITUTE - T | PHPExcel_Calculation_TextData::RETURNSTRING - TEXT | PHPExcel_Calculation_TextData::TEXTFORMAT - TRIM | PHPExcel_Calculation_TextData::TRIMSPACES - UPPER | PHPExcel_Calculation_TextData::UPPERCASE + RIGHT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RIGHT + RIGHTB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RIGHT + SEARCH | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE + SEARCHB | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE + SUBSTITUTE | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SUBSTITUTE + T | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RETURNSTRING + TEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTFORMAT + TRIM | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMSPACES + UPPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData::UPPERCASE VALUE | **\*\*\* Not yet Implemented** diff --git a/docs/Functions/FunctionListByName.md b/docs/Functions/FunctionListByName.md index 0c72aa26..befa5a17 100644 --- a/docs/Functions/FunctionListByName.md +++ b/docs/Functions/FunctionListByName.md @@ -1,81 +1,81 @@ #A - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- ABS | CATEGORY_MATH_AND_TRIG | abs - ACCRINT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::ACCRINT - ACCRINTM | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::ACCRINTM + ACCRINT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ACCRINT + ACCRINTM | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ACCRINTM ACOS | CATEGORY_MATH_AND_TRIG | acos ACOSH | CATEGORY_MATH_AND_TRIG | acosh - ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::CELL_ADDRESS - AMORDEGRC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::AMORDEGRC - AMORLINC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::AMORLINC - AND | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::LOGICAL_AND + ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CELL_ADDRESS + AMORDEGRC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORDEGRC + AMORLINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORLINC + AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_AND AREAS | CATEGORY_LOOKUP_AND_REFERENCE | **\*\*\* Not yet Implemented** ASC | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** ASIN | CATEGORY_MATH_AND_TRIG | asin ASINH | CATEGORY_MATH_AND_TRIG | asinh ATAN | CATEGORY_MATH_AND_TRIG | atan - ATAN2 | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::REVERSE_ATAN2 + ATAN2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::REVERSE_ATAN2 ATANH | CATEGORY_MATH_AND_TRIG | atanh - AVEDEV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::AVEDEV - AVERAGE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::AVERAGE - AVERAGEA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::AVERAGEA - AVERAGEIF | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::AVERAGEIF + AVEDEV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVEDEV + AVERAGE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGE + AVERAGEA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGEA + AVERAGEIF | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGEIF AVERAGEIFS | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - + #B - - Excel Function | Category | PHPExcel Function + + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- BAHTTEXT | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** - BESSELI | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BESSELI - BESSELJ | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BESSELJ - BESSELK | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BESSELK - BESSELY | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BESSELY - BETADIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::BETADIST - BETAINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::BETAINV - BIN2DEC | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BINTODEC - BIN2HEX | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BINTOHEX - BIN2OCT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::BINTOOCT - BINOMDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::BINOMDIST + BESSELI | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELI + BESSELJ | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELJ + BESSELK | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELK + BESSELY | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELY + BETADIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BETADIST + BETAINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BETAINV + BIN2DEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTODEC + BIN2HEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOHEX + BIN2OCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOOCT + BINOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::BINOMDIST #C - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - CEILING | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::CEILING + CEILING | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CEILING CELL | CATEGORY_INFORMATION | **\*\*\* Not yet Implemented** - CHAR | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::CHARACTER - CHIDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CHIDIST - CHIINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CHIINV + CHAR | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CHARACTER + CHIDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CHIDIST + CHIINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CHIINV CHITEST | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - CHOOSE | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::CHOOSE - CLEAN | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::TRIMNONPRINTABLE - CODE | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::ASCIICODE - COLUMN | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::COLUMN - COLUMNS | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::COLUMNS - COMBIN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::COMBIN - COMPLEX | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::COMPLEX - CONCATENATE | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::CONCATENATE - CONFIDENCE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CONFIDENCE - CONVERT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::CONVERTUOM - CORREL | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CORREL + CHOOSE | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CHOOSE + CLEAN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMNONPRINTABLE + CODE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::ASCIICODE + COLUMN | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMN + COLUMNS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMNS + COMBIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN + COMPLEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::COMPLEX + CONCATENATE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::CONCATENATE + CONFIDENCE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CONFIDENCE + CONVERT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::CONVERTUOM + CORREL | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL COS | CATEGORY_MATH_AND_TRIG | cos COSH | CATEGORY_MATH_AND_TRIG | cosh - COUNT | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::COUNT - COUNTA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::COUNTA - COUNTBLANK | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::COUNTBLANK - COUNTIF | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::COUNTIF + COUNT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNT + COUNTA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTA + COUNTBLANK | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTBLANK + COUNTIF | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COUNTIF COUNTIFS | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - COUPDAYBS | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPDAYBS - COUPDAYS | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPDAYS - COUPDAYSNC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPDAYSNC - COUPNCD | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPNCD - COUPNUM | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPNUM - COUPPCD | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::COUPPCD - COVAR | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::COVAR - CRITBINOM | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CRITBINOM + COUPDAYBS | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYBS + COUPDAYS | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYS + COUPDAYSNC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPDAYSNC + COUPNCD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPNCD + COUPNUM | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPNUM + COUPPCD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::COUPPCD + COVAR | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::COVAR + CRITBINOM | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CRITBINOM CUBEKPIMEMBER | CATEGORY_CUBE | **\*\*\* Not yet Implemented** CUBEMEMBER | CATEGORY_CUBE | **\*\*\* Not yet Implemented** CUBEMEMBERPROPERTY | CATEGORY_CUBE | **\*\*\* Not yet Implemented** @@ -83,403 +83,403 @@ CUBESET | CATEGORY_CUBE | **\*\*\* Not yet Implemented** CUBESETCOUNT | CATEGORY_CUBE | **\*\*\* Not yet Implemented** CUBEVALUE | CATEGORY_CUBE | **\*\*\* Not yet Implemented** - CUMIPMT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::CUMIPMT - CUMPRINC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::CUMPRINC + CUMIPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::CUMIPMT + CUMPRINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::CUMPRINC #D - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - DATE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DATE - DATEDIF | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DATEDIF - DATEVALUE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DATEVALUE - DAVERAGE | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DAVERAGE - DAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DAYOFMONTH - DAYS360 | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DAYS360 - DB | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::DB - DCOUNT | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DCOUNT - DCOUNTA | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DCOUNTA - DDB | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::DDB - DEC2BIN | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::DECTOBIN - DEC2HEX | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::DECTOHEX - DEC2OCT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::DECTOOCT + DATE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATE + DATEDIF | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATEDIF + DATEVALUE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATEVALUE + DAVERAGE | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DAVERAGE + DAY | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYOFMONTH + DAYS360 | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DAYS360 + DB | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DB + DCOUNT | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DCOUNT + DCOUNTA | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DCOUNTA + DDB | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DDB + DEC2BIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOBIN + DEC2HEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOHEX + DEC2OCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOOCT DEGREES | CATEGORY_MATH_AND_TRIG | rad2deg - DELTA | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::DELTA - DEVSQ | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::DEVSQ - DGET | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DGET - DISC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::DISC - DMAX | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DMAX - DMIN | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DMIN - DOLLAR | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::DOLLAR - DOLLARDE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::DOLLARDE - DOLLARFR | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::DOLLARFR - DPRODUCT | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DPRODUCT - DSTDEV | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DSTDEV - DSTDEVP | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DSTDEVP - DSUM | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DSUM + DELTA | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DELTA + DEVSQ | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::DEVSQ + DGET | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DGET + DISC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DISC + DMAX | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DMAX + DMIN | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DMIN + DOLLAR | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::DOLLAR + DOLLARDE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DOLLARDE + DOLLARFR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::DOLLARFR + DPRODUCT | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DPRODUCT + DSTDEV | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSTDEV + DSTDEVP | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSTDEVP + DSUM | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DSUM DURATION | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** - DVAR | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DVAR - DVARP | CATEGORY_DATABASE | PHPExcel_Calculation_Database::DVARP + DVAR | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DVAR + DVARP | CATEGORY_DATABASE | \PhpOffice\PhpSpreadsheet\Calculation\Database::DVARP #E - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - EDATE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::EDATE - EFFECT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::EFFECT - EOMONTH | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::EOMONTH - ERF | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::ERF - ERFC | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::ERFC - ERROR.TYPE | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::ERROR_TYPE - EVEN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::EVEN + EDATE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EDATE + EFFECT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::EFFECT + EOMONTH | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH + ERF | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF + ERFC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC + ERROR.TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE + EVEN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN EXACT | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** EXP | CATEGORY_MATH_AND_TRIG | exp - EXPONDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::EXPONDIST + EXPONDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::EXPONDIST #F - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - FACT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::FACT - FACTDOUBLE | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::FACTDOUBLE - FALSE | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::FALSE + FACT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACT + FACTDOUBLE | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACTDOUBLE + FALSE | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE FDIST | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - FIND | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::SEARCHSENSITIVE - FINDB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::SEARCHSENSITIVE + FIND | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE + FINDB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE FINV | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - FISHER | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::FISHER - FISHERINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::FISHERINV - FIXED | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::FIXEDFORMAT - FLOOR | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::FLOOR - FORECAST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::FORECAST + FISHER | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHER + FISHERINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHERINV + FIXED | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT + FLOOR | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FLOOR + FORECAST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FORECAST FREQUENCY | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** FTEST | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - FV | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::FV - FVSCHEDULE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::FVSCHEDULE + FV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::FV + FVSCHEDULE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::FVSCHEDULE #G - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - GAMMADIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::GAMMADIST - GAMMAINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::GAMMAINV - GAMMALN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::GAMMALN - GCD | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::GCD - GEOMEAN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::GEOMEAN - GESTEP | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::GESTEP + GAMMADIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMADIST + GAMMAINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMAINV + GAMMALN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMALN + GCD | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::GCD + GEOMEAN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GEOMEAN + GESTEP | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::GESTEP GETPIVOTDATA | CATEGORY_LOOKUP_AND_REFERENCE | **\*\*\* Not yet Implemented** - GROWTH | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::GROWTH + GROWTH | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GROWTH #H - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - HARMEAN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::HARMEAN - HEX2BIN | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::HEXTOBIN - HEX2DEC | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::HEXTODEC - HEX2OCT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::HEXTOOCT + HARMEAN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::HARMEAN + HEX2BIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOBIN + HEX2DEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTODEC + HEX2OCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::HEXTOOCT HLOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | **\*\*\* Not yet Implemented** - HOUR | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::HOUROFDAY - HYPERLINK | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::HYPERLINK - HYPGEOMDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::HYPGEOMDIST + HOUR | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::HOUROFDAY + HYPERLINK | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::HYPERLINK + HYPGEOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::HYPGEOMDIST #I - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - IF | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::STATEMENT_IF - IFERROR | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::IFERROR - IMABS | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMABS - IMAGINARY | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMAGINARY - IMARGUMENT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMARGUMENT - IMCONJUGATE | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMCONJUGATE - IMCOS | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMCOS - IMDIV | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMDIV - IMEXP | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMEXP - IMLN | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMLN - IMLOG10 | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMLOG10 - IMLOG2 | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMLOG2 - IMPOWER | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMPOWER - IMPRODUCT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMPRODUCT - IMREAL | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMREAL - IMSIN | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMSIN - IMSQRT | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMSQRT - IMSUB | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMSUB - IMSUM | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::IMSUM - INDEX | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::INDEX - INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::INDIRECT + IF | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF + IFERROR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR + IMABS | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMABS + IMAGINARY | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMAGINARY + IMARGUMENT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT + IMCONJUGATE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE + IMCOS | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS + IMDIV | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV + IMEXP | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP + IMLN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN + IMLOG10 | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG10 + IMLOG2 | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG2 + IMPOWER | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER + IMPRODUCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT + IMREAL | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL + IMSIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN + IMSQRT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT + IMSUB | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB + IMSUM | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM + INDEX | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX + INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT INFO | CATEGORY_INFORMATION | **\*\*\* Not yet Implemented** - INT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::INT - INTERCEPT | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::INTERCEPT - INTRATE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::INTRATE - IPMT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::IPMT - IRR | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::IRR - ISBLANK | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_BLANK - ISERR | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_ERR - ISERROR | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_ERROR - ISEVEN | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_EVEN - ISLOGICAL | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_LOGICAL - ISNA | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_NA - ISNONTEXT | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_NONTEXT - ISNUMBER | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_NUMBER - ISODD | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_ODD - ISPMT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::ISPMT + INT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::INT + INTERCEPT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::INTERCEPT + INTRATE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::INTRATE + IPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IPMT + IRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IRR + ISBLANK | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK + ISERR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR + ISERROR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR + ISEVEN | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN + ISLOGICAL | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL + ISNA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA + ISNONTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT + ISNUMBER | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NUMBER + ISODD | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ODD + ISPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ISPMT ISREF | CATEGORY_INFORMATION | **\*\*\* Not yet Implemented** - ISTEXT | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::IS_TEXT + ISTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_TEXT #J - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- JIS | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** #K - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - KURT | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::KURT + KURT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::KURT #L - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - LARGE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::LARGE - LCM | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::LCM - LEFT | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::LEFT - LEFTB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::LEFT - LEN | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::STRINGLENGTH - LENB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::STRINGLENGTH - LINEST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::LINEST + LARGE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LARGE + LCM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LCM + LEFT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LEFT + LEFTB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LEFT + LEN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENGTH + LENB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENGTH + LINEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LINEST LN | CATEGORY_MATH_AND_TRIG | log - LOG | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::LOG_BASE + LOG | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LOG_BASE LOG10 | CATEGORY_MATH_AND_TRIG | log10 - LOGEST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::LOGEST - LOGINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::LOGINV - LOGNORMDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::LOGNORMDIST - LOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::LOOKUP - LOWER | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::LOWERCASE + LOGEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGEST + LOGINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGINV + LOGNORMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGNORMDIST + LOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::LOOKUP + LOWER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::LOWERCASE #M - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - MATCH | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::MATCH - MAX | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MAX - MAXA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MAXA - MAXIF | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MAXIF - MDETERM | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MDETERM + MATCH | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::MATCH + MAX | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAX + MAXA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAXA + MAXIF | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MAXIF + MDETERM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MDETERM MDURATION | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** - MEDIAN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MEDIAN + MEDIAN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MEDIAN MEDIANIF | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - MID | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::MID - MIDB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::MID - MIN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MIN - MINA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MINA - MINIF | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MINIF - MINUTE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::MINUTE - MINVERSE | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MINVERSE - MIRR | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::MIRR - MMULT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MMULT - MOD | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MOD - MODE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MODE - MONTH | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::MONTHOFYEAR - MROUND | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MROUND - MULTINOMIAL | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MULTINOMIAL + MID | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID + MIDB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::MID + MIN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MIN + MINA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINA + MINIF | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MINIF + MINUTE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE + MINVERSE | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MINVERSE + MIRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::MIRR + MMULT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MMULT + MOD | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MOD + MODE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::MODE + MONTH | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::MONTHOFYEAR + MROUND | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MROUND + MULTINOMIAL | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MULTINOMIAL #N - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - N | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::N - NA | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::NA - NEGBINOMDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::NEGBINOMDIST - NETWORKDAYS | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::NETWORKDAYS - NOMINAL | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::NOMINAL - NORMDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::NORMDIST - NORMINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::NORMINV - NORMSDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::NORMSDIST - NORMSINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::NORMSINV - NOT | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::NOT - NOW | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DATETIMENOW - NPER | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::NPER - NPV | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::NPV + N | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::N + NA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::NA + NEGBINOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NEGBINOMDIST + NETWORKDAYS | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::NETWORKDAYS + NOMINAL | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NOMINAL + NORMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMDIST + NORMINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMINV + NORMSDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMSDIST + NORMSINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NORMSINV + NOT | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::NOT + NOW | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATETIMENOW + NPER | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPER + NPV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::NPV #O - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - OCT2BIN | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::OCTTOBIN - OCT2DEC | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::OCTTODEC - OCT2HEX | CATEGORY_ENGINEERING | PHPExcel_Calculation_Engineering::OCTTOHEX - ODD | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::ODD + OCT2BIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOBIN + OCT2DEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTODEC + OCT2HEX | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOHEX + ODD | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ODD ODDFPRICE | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** ODDFYIELD | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** ODDLPRICE | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** ODDLYIELD | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** - OFFSET | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::OFFSET - OR | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::LOGICAL_OR + OFFSET | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::OFFSET + OR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::LOGICAL_OR #P - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - PEARSON | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::CORREL - PERCENTILE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::PERCENTILE - PERCENTRANK | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::PERCENTRANK - PERMUT | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::PERMUT + PEARSON | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::CORREL + PERCENTILE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTILE + PERCENTRANK | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERCENTRANK + PERMUT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::PERMUT PHONETIC | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** PI | CATEGORY_MATH_AND_TRIG | pi - PMT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PMT - POISSON | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::POISSON - POWER | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::POWER - PPMT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PPMT - PRICE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PRICE - PRICEDISC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PRICEDISC - PRICEMAT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PRICEMAT + PMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PMT + POISSON | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::POISSON + POWER | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::POWER + PPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PPMT + PRICE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICE + PRICEDISC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEDISC + PRICEMAT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PRICEMAT PROB | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - PRODUCT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::PRODUCT - PROPER | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::PROPERCASE - PV | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::PV + PRODUCT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::PRODUCT + PROPER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::PROPERCASE + PV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::PV #Q - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - QUARTILE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::QUARTILE - QUOTIENT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::QUOTIENT + QUARTILE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::QUARTILE + QUOTIENT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::QUOTIENT #R - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- RADIANS | CATEGORY_MATH_AND_TRIG | deg2rad - RAND | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::RAND - RANDBETWEEN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::RAND - RANK | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::RANK - RATE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::RATE - RECEIVED | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::RECEIVED - REPLACE | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::REPLACE - REPLACEB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::REPLACE + RAND | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::RAND + RANDBETWEEN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::RAND + RANK | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::RANK + RATE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RATE + RECEIVED | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::RECEIVED + REPLACE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE + REPLACEB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::REPLACE REPT | CATEGORY_TEXT_AND_DATA | str_repeat - RIGHT | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::RIGHT - RIGHTB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::RIGHT - ROMAN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::ROMAN + RIGHT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RIGHT + RIGHTB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RIGHT + ROMAN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROMAN ROUND | CATEGORY_MATH_AND_TRIG | round - ROUNDDOWN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::ROUNDDOWN - ROUNDUP | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::ROUNDUP - ROW | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::ROW - ROWS | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::ROWS - RSQ | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::RSQ + ROUNDDOWN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDDOWN + ROUNDUP | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ROUNDUP + ROW | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROW + ROWS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROWS + RSQ | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::RSQ RTD | CATEGORY_LOOKUP_AND_REFERENCE | **\*\*\* Not yet Implemented** #S - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - SEARCH | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::SEARCHINSENSITIVE - SEARCHB | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::SEARCHINSENSITIVE - SECOND | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::SECOND - SERIESSUM | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SERIESSUM - SIGN | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SIGN + SEARCH | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE + SEARCHB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHINSENSITIVE + SECOND | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::SECOND + SERIESSUM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SERIESSUM + SIGN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SIGN SIN | CATEGORY_MATH_AND_TRIG | sin SINH | CATEGORY_MATH_AND_TRIG | sinh - SKEW | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::SKEW - SLN | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::SLN - SLOPE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::SLOPE - SMALL | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::SMALL + SKEW | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SKEW + SLN | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SLN + SLOPE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SLOPE + SMALL | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SMALL SQRT | CATEGORY_MATH_AND_TRIG | sqrt - SQRTPI | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SQRTPI - STANDARDIZE | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STANDARDIZE - STDEV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STDEV - STDEVA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STDEVA - STDEVP | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STDEVP - STDEVPA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STDEVPA - STEYX | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::STEYX - SUBSTITUTE | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::SUBSTITUTE - SUBTOTAL | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUBTOTAL - SUM | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUM - SUMIF | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMIF + SQRTPI | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI + STANDARDIZE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE + STDEV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV + STDEVA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA + STDEVP | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP + STDEVPA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA + STEYX | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STEYX + SUBSTITUTE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::SUBSTITUTE + SUBTOTAL | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUBTOTAL + SUM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUM + SUMIF | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMIF SUMIFS | CATEGORY_MATH_AND_TRIG | **\*\*\* Not yet Implemented** - SUMPRODUCT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMPRODUCT - SUMSQ | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMSQ - SUMX2MY2 | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMX2MY2 - SUMX2PY2 | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMX2PY2 - SUMXMY2 | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::SUMXMY2 - SYD | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::SYD + SUMPRODUCT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMPRODUCT + SUMSQ | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMSQ + SUMX2MY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2 + SUMX2PY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2PY2 + SUMXMY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMXMY2 + SYD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SYD #T - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - T | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::RETURNSTRING + T | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::RETURNSTRING TAN | CATEGORY_MATH_AND_TRIG | tan TANH | CATEGORY_MATH_AND_TRIG | tanh - TBILLEQ | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::TBILLEQ - TBILLPRICE | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::TBILLPRICE - TBILLYIELD | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::TBILLYIELD - TDIST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::TDIST - TEXT | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::TEXTFORMAT - TIME | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::TIME - TIMEVALUE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::TIMEVALUE - TINV | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::TINV - TODAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::DATENOW - TRANSPOSE | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::TRANSPOSE - TREND | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::TREND - TRIM | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::TRIMSPACES - TRIMMEAN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::TRIMMEAN - TRUE | CATEGORY_LOGICAL | PHPExcel_Calculation_Logical::TRUE - TRUNC | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::TRUNC + TBILLEQ | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLEQ + TBILLPRICE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLPRICE + TBILLYIELD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::TBILLYIELD + TDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TDIST + TEXT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TEXTFORMAT + TIME | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIME + TIMEVALUE | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE + TINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TINV + TODAY | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATENOW + TRANSPOSE | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::TRANSPOSE + TREND | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TREND + TRIM | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::TRIMSPACES + TRIMMEAN | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::TRIMMEAN + TRUE | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::TRUE + TRUNC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::TRUNC TTEST | CATEGORY_STATISTICAL | **\*\*\* Not yet Implemented** - TYPE | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::TYPE + TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE #U - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - UPPER | CATEGORY_TEXT_AND_DATA | PHPExcel_Calculation_TextData::UPPERCASE + UPPER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::UPPERCASE USDOLLAR | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** #V - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- VALUE | CATEGORY_TEXT_AND_DATA | **\*\*\* Not yet Implemented** - VAR | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::VARFunc - VARA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::VARA - VARP | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::VARP - VARPA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::VARPA + VAR | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARFunc + VARA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARA + VARP | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARP + VARPA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::VARPA VDB | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** - VERSION | CATEGORY_INFORMATION | PHPExcel_Calculation_Functions::VERSION - VLOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | PHPExcel_Calculation_LookupRef::VLOOKUP + VERSION | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::VERSION + VLOOKUP | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::VLOOKUP #W - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - WEEKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WEEKDAY - WEEKNUM | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WEEKNUM - WEIBULL | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::WEIBULL - WORKDAY | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::WORKDAY + WEEKDAY | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKDAY + WEEKNUM | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKNUM + WEIBULL | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::WEIBULL + WORKDAY | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::WORKDAY #X - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - XIRR | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::XIRR - XNPV | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::XNPV + XIRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XIRR + XNPV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XNPV #Y - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - YEAR | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::YEAR - YEARFRAC | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::YEARFRAC + YEAR | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::YEAR + YEARFRAC | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::YEARFRAC YIELD | CATEGORY_FINANCIAL | **\*\*\* Not yet Implemented** - YIELDDISC | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::YIELDDISC - YIELDMAT | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::YIELDMAT + YIELDDISC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::YIELDDISC + YIELDMAT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::YIELDMAT #Z - Excel Function | Category | PHPExcel Function + Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- - ZTEST | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::ZTEST + ZTEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::ZTEST diff --git a/docs/Overview/01-Getting-Started.md b/docs/Overview/01-Getting-Started.md index e89998b5..f2a125d0 100644 --- a/docs/Overview/01-Getting-Started.md +++ b/docs/Overview/01-Getting-Started.md @@ -1,11 +1,11 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Prerequisites, Installation, FAQ and Links ### Software requirements -The following software is required to develop using PHPExcel: +The following software is required to develop using PhpSpreadsheet: - PHP version 5.5 or newer - PHP extension php_zip enabled [^phpzip_footnote] @@ -47,7 +47,7 @@ http://example.com/Tests/02types.php ### Useful links and tools -There are some links and tools which are very useful when developing using PHPExcel. Please refer to the [PHPExcel CodePlex pages][2] for an update version of the list below. +There are some links and tools which are very useful when developing using PhpSpreadsheet. Please refer to the [PHPExcel CodePlex pages][2] for an update version of the list below. #### OpenXML / SpreadsheetML @@ -67,23 +67,23 @@ The up-to-date F.A.Q. page for PHPExcel can be found on [http://www.codeplex.com ##### There seems to be a problem with character encoding... -It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script uses different encoding then you can convert those texts with PHP's iconv() or mb_convert_encoding() functions. +It is necessary to use UTF-8 encoding for all texts in PhpSpreadsheet. If the script uses different encoding then you can convert those texts with PHP's iconv() or mb_convert_encoding() functions. ##### PHP complains about ZipArchive not being found Make sure you meet all requirements, especially php_zip extension should be enabled. -The ZipArchive class is only required when reading or writing formats that use Zip compression (Xlsx and Ods). Since version 1.7.6 the PCLZip library has been bundled with PHPExcel as an alternative to the ZipArchive class. +The ZipArchive class is only required when reading or writing formats that use Zip compression (Xlsx and Ods). Since version 1.7.6 the PCLZip library has been bundled with PhpSpreadsheet as an alternative to the ZipArchive class. This can be enabled by calling: ```php -PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP); +\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP); ``` *before* calling the save method of the Xlsx Writer. You can revert to using ZipArchive by calling: ```php -PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE); +\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::ZIPARCHIVE); ``` At present, this only allows you to write Xlsx files without the need for ZipArchive (not to read Xlsx or Ods) @@ -99,22 +99,22 @@ If you can't locate a clean copy of ZipArchive, then you can use the PCLZip libr ##### Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa -PHPExcel holds an "in memory" representation of a spreadsheet, so it is susceptible to PHP's memory limitations. The memory made available to PHP can be increased by editing the value of the memory_limit directive in your php.ini file, or by using ini_set('memory_limit', '128M') within your code (ISP permitting). +PhpSpreadsheet holds an "in memory" representation of a spreadsheet, so it is susceptible to PHP's memory limitations. The memory made available to PHP can be increased by editing the value of the memory_limit directive in your php.ini file, or by using ini_set('memory_limit', '128M') within your code (ISP permitting). -Some Readers and Writers are faster than others, and they also use differing amounts of memory. You can find some indication of the relative performance and memory usage for the different Readers and Writers, over the different versions of PHPExcel, on the [discussion board][9]. +Some Readers and Writers are faster than others, and they also use differing amounts of memory. You can find some indication of the relative performance and memory usage for the different Readers and Writers, over the different versions of PhpSpreadsheet, on the [discussion board][9]. -If you've already increased memory to a maximum, or can't change your memory limit, then [this discussion][10] on the board describes some of the methods that can be applied to reduce the memory usage of your scripts using PHPExcel. +If you've already increased memory to a maximum, or can't change your memory limit, then [this discussion][10] on the board describes some of the methods that can be applied to reduce the memory usage of your scripts using PhpSpreadsheet. ##### Protection on my worksheet is not working? When you make use of any of the worksheet protection features (e.g. cell range protection, prohibiting deleting rows, ...), make sure you enable worksheet security. This can for example be done like this: ```php -$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); +$spreadsheet->getActiveSheet()->getProtection()->setSheet(true); ``` -##### Feature X is not working with PHPExcel_Reader_Y / PHPExcel_Writer_Z +##### Feature X is not working with Reader_Y / Writer_Z -Not all features of PHPExcel are implemented in all of the Reader / Writer classes. This is mostly due to underlying libraries not supporting a specific feature or not having implemented a specific feature. +Not all features of PhpSpreadsheet are implemented in all of the Reader / Writer classes. This is mostly due to underlying libraries not supporting a specific feature or not having implemented a specific feature. For example autofilter is not implemented in PEAR Spreadsheet_Excel_writer, which is the base of our Xls writer. @@ -122,25 +122,25 @@ We are slowly building up a list of features, together with the different reader ##### Formulas don't seem to be calculated in Excel2003 using compatibility pack? -This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003. +This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use \PhpOffice\PhpSpreadsheet\Writer\Xls if you really need calculated values, or force recalculation in Excel2003. ##### Setting column width is not 100% accurate Trying to set column width, I experience one problem. When I open the file in Excel, the actual width is 0.71 less than it should be. -The short answer is that PHPExcel uses a measure where padding is included. See section: "Setting a column's width" for more details. +The short answer is that PhpSpreadsheet uses a measure where padding is included. See section: "Setting a column's width" for more details. -##### How do I use PHPExcel with my framework +##### How do I use PhpSpreadsheet with my framework - - There are some instructions for using PHPExcel with Joomla on the [Joomla message board][11] - - A page of advice on using [PHPExcel in the Yii framework][12] - - [The Bakery][13] has some helper classes for reading and writing with PHPExcel within CakePHP - - Integrating [PHPExcel into Kohana 3][14] and [?????????? PHPExcel ? Kohana Framework][15] - - Using [PHPExcel with Typo3][16] + - There are some instructions for using PhpSpreadsheet with Joomla on the [Joomla message board][11] + - A page of advice on using [PhpSpreadsheet in the Yii framework][12] + - [The Bakery][13] has some helper classes for reading and writing with PhpSpreadsheet within CakePHP + - Integrating [PhpSpreadsheet into Kohana 3][14] and [?????????? PHPExcel ? Kohana Framework][15] + - Using [PhpSpreadsheet with TYPO3][16] -##### Joomla Autoloader interferes with PHPExcel Autoloader +##### Joomla Autoloader interferes with PhpSpreadsheet Autoloader -Thanks to peterrlynch for the following advice on resolving issues between the [PHPExcel autoloader and Joomla Autoloader][17] +Thanks to peterrlynch for the following advice on resolving issues between the [PhpSpreadsheet autoloader and Joomla Autoloader][17] #### Tutorials @@ -177,5 +177,5 @@ Thanks to peterrlynch for the following advice on resolving issues between the [ [21]: http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html -[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.
You can remove this dependency for writing Xlsx files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled. +[^phpzip_footnote]: __php_zip__ is only needed by __\PhpOffice\PhpSpreadsheet\Reader\Xlsx__, __\PhpOffice\PhpSpreadsheet\Writer\Xlsx__ and __\PhpOffice\PhpSpreadsheet\Reader\Ods__. In other words, if you need PhpSpreadsheet to handle .xlsx or .ods files you will need the zip extension, but otherwise not.
You can remove this dependency for writing Xlsx files (though not yet for reading) by using the PCLZip library that is bundled with PhpSpreadsheet. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled. diff --git a/docs/Overview/02-Architecture.md b/docs/Overview/02-Architecture.md index 8ddb43e2..4e2e44d8 100644 --- a/docs/Overview/02-Architecture.md +++ b/docs/Overview/02-Architecture.md @@ -1,4 +1,4 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Architecture @@ -10,9 +10,9 @@ ### Lazy Loader -PHPExcel implements an autoloader or "lazy loader", which means that it is not necessary to include every file within PHPExcel. It is only necessary to include the initial PHPExcel class file, then the autoloader will include other class files as and when required, so only those files that are actually required by your script will be loaded into PHP memory. The main benefit of this is that it reduces the memory footprint of PHPExcel itself, so that it uses less PHP memory. +PhpSpreadsheet implements an autoloader or "lazy loader", which means that it is not necessary to include every file within PhpSpreadsheet. It is only necessary to include the initial PhpSpreadsheet class file, then the autoloader will include other class files as and when required, so only those files that are actually required by your script will be loaded into PHP memory. The main benefit of this is that it reduces the memory footprint of PhpSpreadsheet itself, so that it uses less PHP memory. -If your own scripts already define an autoload function, then this may be overwritten by the PHPExcel autoload function. For example, if you have: +If your own scripts already define an autoload function, then this may be overwritten by the PhpSpreadsheet autoload function. For example, if you have: ```php function __autoload($class) { ... @@ -26,42 +26,42 @@ function myAutoload($class) { spl_autoload_register('myAutoload'); ``` -Your autoloader will then co-exist with the autoloader of PHPExcel. +Your autoloader will then co-exist with the autoloader of PhpSpreadsheet. ### Spreadsheet in memory -PHPExcel's architecture is built in a way that it can serve as an in-memory spreadsheet. This means that, if one would want to create a web based view of a spreadsheet which communicates with PHPExcel's object model, he would only have to write the front-end code. +PhpSpreadsheet's architecture is built in a way that it can serve as an in-memory spreadsheet. This means that, if one would want to create a web based view of a spreadsheet which communicates with PhpSpreadsheet's object model, he would only have to write the front-end code. -Just like desktop spreadsheet software, PHPExcel represents a spreadsheet containing one or more worksheets, which contain cells with data, formulas, images, ... +Just like desktop spreadsheet software, PhpSpreadsheet represents a spreadsheet containing one or more worksheets, which contain cells with data, formulas, images, ... ### Readers and writers -On its own, PHPExcel does not provide the functionality to read from or write to a persisted spreadsheet (on disk or in a database). To provide that functionality, readers and writers can be used. +On its own, PhpSpreadsheet does not provide the functionality to read from or write to a persisted spreadsheet (on disk or in a database). To provide that functionality, readers and writers can be used. -By default, the PHPExcel package provides some readers and writers, including one for the Open XML spreadsheet format (a.k.a. Excel 2007 file format). You are not limited to the default readers and writers, as you are free to implement the PHPExcel_Reader_IReader and PHPExcel_Writer_IWriter interface in a custom class. +By default, the PhpSpreadsheet package provides some readers and writers, including one for the Open XML spreadsheet format (a.k.a. Excel 2007 file format). You are not limited to the default readers and writers, as you are free to implement the \PhpOffice\PhpSpreadsheet\Reader\IReader and \PhpOffice\PhpSpreadsheet\Writer\IWriter interface in a custom class. ![02-readers-writers.png](./images/02-readers-writers.png "Readers/Writers") ### Fluent interfaces -PHPExcel supports fluent interfaces in most locations. This means that you can easily "chain" calls to specific methods without requiring a new PHP statement. For example, take the following code: +PhpSpreadsheet supports fluent interfaces in most locations. This means that you can easily "chain" calls to specific methods without requiring a new PHP statement. For example, take the following code: ```php -$objPHPExcel->getProperties()->setCreator("Maarten Balliauw"); -$objPHPExcel->getProperties()->setLastModifiedBy("Maarten Balliauw"); -$objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Test Document"); -$objPHPExcel->getProperties()->setSubject("Office 2007 XLSX Test Document"); -$objPHPExcel->getProperties()->setDescription("Test document for Office 2007 XLSX, generated using PHP classes."); -$objPHPExcel->getProperties()->setKeywords("office 2007 openxml php"); -$objPHPExcel->getProperties()->setCategory("Test result file"); +$spreadsheet->getProperties()->setCreator("Maarten Balliauw"); +$spreadsheet->getProperties()->setLastModifiedBy("Maarten Balliauw"); +$spreadsheet->getProperties()->setTitle("Office 2007 XLSX Test Document"); +$spreadsheet->getProperties()->setSubject("Office 2007 XLSX Test Document"); +$spreadsheet->getProperties()->setDescription("Test document for Office 2007 XLSX, generated using PHP classes."); +$spreadsheet->getProperties()->setKeywords("office 2007 openxml php"); +$spreadsheet->getProperties()->setCategory("Test result file"); ``` This can be rewritten as: ```php -$objPHPExcel->getProperties() +$spreadsheet->getProperties() ->setCreator("Maarten Balliauw") ->setLastModifiedBy("Maarten Balliauw") ->setTitle("Office 2007 XLSX Test Document") @@ -71,6 +71,6 @@ $objPHPExcel->getProperties() ->setCategory("Test result file"); ``` - > __Using fluent interfaces is not required__ - > Fluent interfaces have been implemented to provide a convenient programming API. Use of them is not required, but can make your code easier to read and maintain. - > It can also improve performance, as you are reducing the overall number of calls to PHPExcel methods: in the above example, the `getProperties()` method is being called only once rather than 7 times in the non-fluent version. + > __Using fluent interfaces is not required__ + > Fluent interfaces have been implemented to provide a convenient programming API. Use of them is not required, but can make your code easier to read and maintain. + > It can also improve performance, as you are reducing the overall number of calls to PhpSpreadsheet methods: in the above example, the `getProperties()` method is being called only once rather than 7 times in the non-fluent version. diff --git a/docs/Overview/03-Creating-a-Spreadsheet.md b/docs/Overview/03-Creating-a-Spreadsheet.md index b65000bf..e36b09ae 100644 --- a/docs/Overview/03-Creating-a-Spreadsheet.md +++ b/docs/Overview/03-Creating-a-Spreadsheet.md @@ -1,34 +1,34 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Creating a spreadsheet -### The PHPExcel class +### The `Spreadsheet` class -The PHPExcel class is the core of PHPExcel. It contains references to the contained worksheets, document security settings and document meta data. +The `Spreadsheet` class is the core of PhpSpreadsheet. It contains references to the contained worksheets, document security settings and document meta data. -To simplify the PHPExcel concept: the PHPExcel class represents your workbook. +To simplify the PhpSpreadsheet concept: the `Spreadsheet` class represents your workbook. Typically, you will create a workbook in one of two ways, either by loading it from a spreadsheet file, or creating it manually. A third option, though less commonly used, is cloning an existing workbook that has been created using one of the previous two methods. #### Loading a Workbook from a file -Details of the different spreadsheet formats supported, and the options available to read them into a PHPExcel object are described fully in the PHPExcel User Documentation - Reading Spreadsheet Files document. +Details of the different spreadsheet formats supported, and the options available to read them into a Spreadsheet object are described fully in the PhpSpreadsheet User Documentation - Reading Spreadsheet Files document. ```php $inputFileName = './sampleData/example1.xls'; -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = PHPExcel_IOFactory::load($inputFileName); +/** Load $inputFileName to a Spreadsheet object **/ +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); ``` #### Creating a new workbook -If you want to create a new workbook, rather than load one from file, then you simply need to instantiate it as a new PHPExcel object. +If you want to create a new workbook, rather than load one from file, then you simply need to instantiate it as a new Spreadsheet object. ```php -/** Create a new PHPExcel Object **/ -$objPHPExcel = new PHPExcel(); +/** Create a new Spreadsheet Object **/ +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); ``` A new workbook will always be created with a single worksheet. diff --git a/docs/Overview/04-Configuration-Settings.md b/docs/Overview/04-Configuration-Settings.md index b5eb9867..51475b9e 100644 --- a/docs/Overview/04-Configuration-Settings.md +++ b/docs/Overview/04-Configuration-Settings.md @@ -1,20 +1,20 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Configuration Settings -Once you have included the PHPExcel files in your script, but before instantiating a PHPExcel object or loading a workbook file, there are a number of configuration options that can be set which will affect the subsequent behaviour of the script. +Once you have included the PhpSpreadsheet files in your script, but before instantiating a `Spreadsheet` object or loading a workbook file, there are a number of configuration options that can be set which will affect the subsequent behaviour of the script. ### Cell Caching -PHPExcel uses an average of about 1k/cell in your worksheets, so large workbooks can quickly use up available memory. Cell caching provides a mechanism that allows PHPExcel to maintain the cell objects in a smaller size of memory, on disk, or in APC, memcache or Wincache, rather than in PHP memory. This allows you to reduce the memory usage for large workbooks, although at a cost of speed to access cell data. +PhpSpreadsheet uses an average of about 1k/cell in your worksheets, so large workbooks can quickly use up available memory. Cell caching provides a mechanism that allows PhpSpreadsheet to maintain the cell objects in a smaller size of memory, on disk, or in APC, memcache or Wincache, rather than in PHP memory. This allows you to reduce the memory usage for large workbooks, although at a cost of speed to access cell data. -By default, PHPExcel still holds all cell objects in memory, but you can specify alternatives. To enable cell caching, you must call the PHPExcel_Settings::setCacheStorageMethod() method, passing in the caching method that you wish to use. +By default, PhpSpreadsheet still holds all cell objects in memory, but you can specify alternatives. To enable cell caching, you must call the \PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod() method, passing in the caching method that you wish to use. ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY; -PHPExcel_Settings::setCacheStorageMethod($cacheMethod); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod); ``` setCacheStorageMethod() will return a boolean true on success, false on failure (for example if trying to cache to APC when APC is not enabled). @@ -23,112 +23,112 @@ A separate cache is maintained for each individual worksheet, and is automatical Currently, the following caching methods are available. -#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY -The default. If you don't initialise any caching method, then this is the method that PHPExcel will use. Cell objects are maintained in PHP memory as at present. +The default. If you don't initialise any caching method, then this is the method that PhpSpreadsheet will use. Cell objects are maintained in PHP memory as at present. -#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY_SERIALIZED +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY_SERIALIZED Using this caching method, cells are held in PHP memory as an array of serialized objects, which reduces the memory footprint with minimal performance overhead. -#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY_GZIP +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY_GZIP Like cache_in_memory_serialized, this method holds cells in PHP memory as an array of serialized objects, but gzipped to reduce the memory usage still further, although access to read or write a cell is slightly slower. -#### PHPExcel_CachedObjectStorageFactory::CACHE_IGBINARY +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IGBINARY Uses PHPs igbinary extension (if its available) to serialize cell objects in memory. This is normally faster and uses less memory than standard PHP serialization, but isnt available in most hosting environments. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_DISCISAM +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_DISCISAM -When using CACHE_TO_DISCISAM all cells are held in a temporary disk file, with only an index to their location in that file maintained in PHP memory. This is slower than any of the CACHE_IN_MEMORY methods, but significantly reduces the memory footprint. By default, PHPExcel will use PHP's temp directory for the cache file, but you can specify a different directory when initialising CACHE_TO_DISCISAM. +When using CACHE_TO_DISCISAM all cells are held in a temporary disk file, with only an index to their location in that file maintained in PHP memory. This is slower than any of the CACHE_IN_MEMORY methods, but significantly reduces the memory footprint. By default, PhpSpreadsheet will use PHP's temp directory for the cache file, but you can specify a different directory when initialising CACHE_TO_DISCISAM. ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_DISCISAM; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_DISCISAM; $cacheSettings = array( 'dir' => '/usr/local/tmp' ); -PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); ``` The temporary disk file is automatically deleted when your script terminates. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_PHPTEMP +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_PHPTEMP Like CACHE_TO_DISCISAM, when using CACHE_TO_PHPTEMP all cells are held in the php://temp I/O stream, with only an index to their location maintained in PHP memory. In PHP, the php://memory wrapper stores data in the memory: php://temp behaves similarly, but uses a temporary file for storing the data when a certain memory limit is reached. The default is 1 MB, but you can change this when initialising CACHE_TO_PHPTEMP. ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_PHPTEMP; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_PHPTEMP; $cacheSettings = array( 'memoryCacheSize' => '8MB' ); -PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); ``` The php://temp file is automatically deleted when your script terminates. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_APC +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_APC When using CACHE_TO_APC, cell objects are maintained in APC with only an index maintained in PHP memory to identify that the cell exists. By default, an APC cache timeout of 600 seconds is used, which should be enough for most applications: although it is possible to change this when initialising CACHE_TO_APC. ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_APC; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_APC; $cacheSettings = array( 'cacheTime' => 600 ); -PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); ``` When your script terminates all entries will be cleared from APC, regardless of the cacheTime value, so it cannot be used for persistent storage using this mechanism. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_MEMCACHE +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_MEMCACHE When using CACHE_TO_MEMCACHE, cell objects are maintained in memcache with only an index maintained in PHP memory to identify that the cell exists. -By default, PHPExcel looks for a memcache server on localhost at port 11211. It also sets a memcache timeout limit of 600 seconds. If you are running memcache on a different server or port, then you can change these defaults when you initialise CACHE_TO_MEMCACHE: +By default, PhpSpreadsheet looks for a memcache server on localhost at port 11211. It also sets a memcache timeout limit of 600 seconds. If you are running memcache on a different server or port, then you can change these defaults when you initialise CACHE_TO_MEMCACHE: ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_MEMCACHE; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_MEMCACHE; $cacheSettings = array( 'memcacheServer' => 'localhost', 'memcachePort' => 11211, 'cacheTime' => 600 ); -PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); ``` When your script terminates all entries will be cleared from memcache, regardless of the cacheTime value, so it cannot be used for persistent storage using this mechanism. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_WINCACHE +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_WINCACHE When using CACHE_TO_WINCACHE, cell objects are maintained in Wincache with only an index maintained in PHP memory to identify that the cell exists. By default, a Wincache cache timeout of 600 seconds is used, which should be enough for most applications: although it is possible to change this when initialising CACHE_TO_WINCACHE. ```php -$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_WINCACHE; +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_WINCACHE; $cacheSettings = array( 'cacheTime' => 600 ); -PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); +\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); ``` When your script terminates all entries will be cleared from Wincache, regardless of the cacheTime value, so it cannot be used for persistent storage using this mechanism. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_SQLITE +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE Uses an SQLite 2 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods. -#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_SQLITE3; +#### \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE3; Uses an SQLite 3 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods. ### Language/Locale -Some localisation elements have been included in PHPExcel. You can set a locale by changing the settings. To set the locale to Brazilian Portuguese you would use: +Some localisation elements have been included in PhpSpreadsheet. You can set a locale by changing the settings. To set the locale to Brazilian Portuguese you would use: ```php $locale = 'pt_br'; -$validLocale = PHPExcel_Settings::setLocale($locale); +$validLocale = \PhpOffice\PhpSpreadsheet\Settings::setLocale($locale); if (!$validLocale) { echo 'Unable to set locale to ' . $locale . " - reverting to en_us" . PHP_EOL; } diff --git a/docs/Overview/05-Deleting-a-Workbook.md b/docs/Overview/05-Deleting-a-Workbook.md index 0ea91712..bbe2f80a 100644 --- a/docs/Overview/05-Deleting-a-Workbook.md +++ b/docs/Overview/05-Deleting-a-Workbook.md @@ -1,13 +1,13 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Clearing a Workbook from memory -The PHPExcel object contains cyclic references (e.g. the workbook is linked to the worksheets, and the worksheets are linked to their parent workbook) which cause problems when PHP tries to clear the objects from memory when they are unset(), or at the end of a function when they are in local scope. The result of this is "memory leaks", which can easily use a large amount of PHP's limited memory. +The PhpSpreadsheet object contains cyclic references (e.g. the workbook is linked to the worksheets, and the worksheets are linked to their parent workbook) which cause problems when PHP tries to clear the objects from memory when they are unset(), or at the end of a function when they are in local scope. The result of this is "memory leaks", which can easily use a large amount of PHP's limited memory. -This can only be resolved manually: if you need to unset a workbook, then you also need to "break" these cyclic references before doing so. PHPExcel provides the disconnectWorksheets() method for this purpose. +This can only be resolved manually: if you need to unset a workbook, then you also need to "break" these cyclic references before doing so. PhpSpreadsheet provides the disconnectWorksheets() method for this purpose. ```php -$objPHPExcel->disconnectWorksheets(); +$spreadsheet->disconnectWorksheets(); -unset($objPHPExcel); +unset($spreadsheet); ``` diff --git a/docs/Overview/06-Worksheets.md b/docs/Overview/06-Worksheets.md index c1553b59..421215a8 100644 --- a/docs/Overview/06-Worksheets.md +++ b/docs/Overview/06-Worksheets.md @@ -1,4 +1,4 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Worksheets @@ -6,7 +6,7 @@ A worksheet is a collection of cells, formulae, images, graphs, etc. It holds al When you load a workbook from a spreadsheet file, it will be loaded with all its existing worksheets (unless you specified that only certain sheets should be loaded). When you load from non-spreadsheet files (such as a CSV or HTML file) or from spreadsheet formats that don't identify worksheets by name (such as SYLK), then a single worksheet called "WorkSheet1" will be created containing the data from that file. -When you instantiate a new workbook, PHPExcel will create it with a single worksheet called "WorkSheet1". +When you instantiate a new workbook, PhpSpreadsheet will create it with a single worksheet called "WorkSheet1". The `getSheetCount()` method will tell you the number of worksheets in the workbook; while the `getSheetNames()` method will return a list of all worksheets in the workbook, indexed by the order in which their "tabs" would appear when opened in MS Excel (or other appropriate Spreadsheet program). @@ -15,7 +15,7 @@ Individual worksheets can be accessed by name, or by their index position in the ```php // Get the second sheet in the workbook // Note that sheets are indexed from 0 -$objPHPExcel->getSheet(1); +$spreadsheet->getSheet(1); ``` If you don't specify a sheet index, then the first worksheet will be returned. @@ -26,24 +26,24 @@ To access a sheet by name, use the `getSheetByName()` method, specifying the nam ```php // Retrieve the worksheet called 'Worksheet 1' -$objPHPExcel->getSheetByName('Worksheet 1'); +$spreadsheet->getSheetByName('Worksheet 1'); ``` Alternatively, one worksheet is always the currently active worksheet, and you can access that directly. The currently active worksheet is the one that will be active when the workbook is opened in MS Excel (or other appropriate Spreadsheet program). ```php // Retrieve the current active worksheet -$objPHPExcel->getActiveSheet(); +$spreadsheet->getActiveSheet(); ``` You can change the currently active sheet by index or by name using the `setActiveSheetIndex()` and `setActiveSheetIndexByName()` methods. ### Adding a new Worksheet -You can add a new worksheet to the workbook using the `createSheet()` method of the PHPExcel object. By default, this will be created as a new "last" sheet; but you can also specify an index position as an argument, and the worksheet will be inserted at that position, shuffling all subsequent worksheets in the collection down a place. +You can add a new worksheet to the workbook using the `createSheet()` method of the `Spreadsheet` object. By default, this will be created as a new "last" sheet; but you can also specify an index position as an argument, and the worksheet will be inserted at that position, shuffling all subsequent worksheets in the collection down a place. ```php -$objPHPExcel->createSheet(); +$spreadsheet->createSheet(); ``` A new worksheet created using this method will be called "Worksheet\" where "\" is the lowest number possible to guarantee that the title is unique. @@ -52,10 +52,10 @@ Alternatively, you can instantiate a new worksheet (setting the title to whateve ```php // Create a new worksheet called "My Data" -$myWorkSheet = new PHPExcel_Worksheet($objPHPExcel, 'My Data'); +$myWorkSheet = new \PhpOffice\PhpSpreadsheet\Worksheet($spreadsheet, 'My Data'); -// Attach the "My Data" worksheet as the first worksheet in the PHPExcel object -$objPHPExcel->addSheet($myWorkSheet, 0); +// Attach the "My Data" worksheet as the first worksheet in the Spreadsheet object +$spreadsheet->addSheet($myWorkSheet, 0); ``` If you don't specify an index position as the second argument, then the new worksheet will be added after the last existing worksheet. @@ -65,29 +65,29 @@ If you don't specify an index position as the second argument, then the new work Sheets within the same workbook can be copied by creating a clone of the worksheet you wish to copy, and then using the addSheet() method to insert the clone into the workbook. ```php -$objClonedWorksheet = clone $objPHPExcel->getSheetByName('Worksheet 1'); +$objClonedWorksheet = clone $spreadsheet->getSheetByName('Worksheet 1'); $objClonedWorksheet->setTitle('Copy of Worksheet 1') -$objPHPExcel->addSheet($objClonedWorksheet); +$spreadsheet->addSheet($objClonedWorksheet); ``` -You can also copy worksheets from one workbook to another, though this is more complex as PHPExcel also has to replicate the styling between the two workbooks. The addExternalSheet() method is provided for this purpose. +You can also copy worksheets from one workbook to another, though this is more complex as PhpSpreadsheet also has to replicate the styling between the two workbooks. The addExternalSheet() method is provided for this purpose. ``` -$objClonedWorksheet = clone $objPHPExcel1->getSheetByName('Worksheet 1'); -$objPHPExcel->addExternalSheet($objClonedWorksheet); +$objClonedWorksheet = clone $spreadsheet1->getSheetByName('Worksheet 1'); +$spreadsheet->addExternalSheet($objClonedWorksheet); ``` -In both cases, it is the developer's responsibility to ensure that worksheet names are not duplicated. PHPExcel will throw an exception if you attempt to copy worksheets that will result in a duplicate name. +In both cases, it is the developer's responsibility to ensure that worksheet names are not duplicated. PhpSpreadsheet will throw an exception if you attempt to copy worksheets that will result in a duplicate name. ### Removing a Worksheet You can delete a worksheet from a workbook, identified by its index position, using the removeSheetByIndex() method ```php -$sheetIndex = $objPHPExcel->getIndex( - $objPHPExcel->getSheetByName('Worksheet 1') +$sheetIndex = $spreadsheet->getIndex( + $spreadsheet->getSheetByName('Worksheet 1') ); -$objPHPExcel->removeSheetByIndex($sheetIndex); +$spreadsheet->removeSheetByIndex($sheetIndex); ``` If the currently active worksheet is deleted, then the sheet at the previous index position will become the currently active sheet. diff --git a/docs/Overview/07-Accessing-Cells.md b/docs/Overview/07-Accessing-Cells.md index 010e534b..721a4836 100644 --- a/docs/Overview/07-Accessing-Cells.md +++ b/docs/Overview/07-Accessing-Cells.md @@ -1,8 +1,8 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Accessing cells -Accessing cells in a PHPExcel worksheet should be pretty straightforward. This topic lists some of the options to access a cell. +Accessing cells in a Spreadsheet should be pretty straightforward. This topic lists some of the options to access a cell. ### Setting a cell value by coordinate @@ -10,17 +10,17 @@ Setting a cell value by coordinate can be done using the worksheet's `setCellVal ```php // Set cell A1 with a string value -$objPHPExcel->getActiveSheet()->setCellValue('A1', 'PHPExcel'); +$spreadsheet->getActiveSheet()->setCellValue('A1', 'PhpSpreadsheet'); // Set cell A2 with a numeric value -$objPHPExcel->getActiveSheet()->setCellValue('A2', 12345.6789); +$spreadsheet->getActiveSheet()->setCellValue('A2', 12345.6789); // Set cell A3 with a boolean value -$objPHPExcel->getActiveSheet()->setCellValue('A3', TRUE); +$spreadsheet->getActiveSheet()->setCellValue('A3', TRUE); // Set cell A4 with a formula -$objPHPExcel->getActiveSheet()->setCellValue( - 'A4', +$spreadsheet->getActiveSheet()->setCellValue( + 'A4', '=IF(A3, CONCATENATE(A1, " ", A2), CONCATENATE(A2, " ", A1))' ); ``` @@ -28,7 +28,7 @@ $objPHPExcel->getActiveSheet()->setCellValue( Alternatively, you can retrieve the cell object, and then call the cell’s setValue() method: ```php -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getCell('B8') ->setValue('Some value'); ``` @@ -44,9 +44,9 @@ MS Excel supports 7 basic datatypes - error - Inline (or rich text) string -By default, when you call the worksheet's `setCellValue()` method or the cell's `setValue()` method, PHPExcel will use the appropriate datatype for PHP nulls, booleans, floats or integers; or cast any string data value that you pass to the method into the most appropriate datatype, so numeric strings will be cast to numbers, while string values beginning with “=” will be converted to a formula. Strings that aren't numeric, or that don't begin with a leading "=" will be treated as genuine string values. +By default, when you call the worksheet's `setCellValue()` method or the cell's `setValue()` method, PhpSpreadsheet will use the appropriate datatype for PHP nulls, booleans, floats or integers; or cast any string data value that you pass to the method into the most appropriate datatype, so numeric strings will be cast to numbers, while string values beginning with “=” will be converted to a formula. Strings that aren't numeric, or that don't begin with a leading "=" will be treated as genuine string values. -This "conversion" is handled by a cell "value binder", and you can write custom "value binders" to change the behaviour of these "conversions". The standard PHPExcel package also provides an "advanced value binder" that handles a number of more complex conversions, such as converting strings with a fractional format like "3/4" to a number value (0.75 in this case) and setting an appropriate "fraction" number format mask. Similarly, strings like "5%" will be converted to a value of 0.05, and a percentage number format mask applied, and strings containing values that look like dates will be converted to Excel serialized datetimestamp values, and a corresponding mask applied. This is particularly useful when loading data from csv files, or setting cell values from a database. +This "conversion" is handled by a cell "value binder", and you can write custom "value binders" to change the behaviour of these "conversions". The standard PhpSpreadsheet package also provides an "advanced value binder" that handles a number of more complex conversions, such as converting strings with a fractional format like "3/4" to a number value (0.75 in this case) and setting an appropriate "fraction" number format mask. Similarly, strings like "5%" will be converted to a value of 0.05, and a percentage number format mask applied, and strings containing values that look like dates will be converted to Excel serialized datetimestamp values, and a corresponding mask applied. This is particularly useful when loading data from csv files, or setting cell values from a database. Formats handled by the advanced value binder include - TRUE or FALSE (dependent on locale settings) are converted to booleans. @@ -65,36 +65,36 @@ Date or time values are held as timestamp in Excel (a simple floating point valu ```php // Get the current date/time and convert to an Excel date/time $dateTimeNow = time(); -$excelDateValue = PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ); +$excelDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel( $dateTimeNow ); // Set cell A6 with the Excel date/time value -$objPHPExcel->getActiveSheet()->setCellValue( - 'A6', +$spreadsheet->getActiveSheet()->setCellValue( + 'A6', $excelDateValue ); // Set the number format mask so that the excel timestamp will be displayed as a human-readable date/time -$objPHPExcel->getActiveSheet()->getStyle('A6') +$spreadsheet->getActiveSheet()->getStyle('A6') ->getNumberFormat() ->setFormatCode( - PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME + \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME ); ``` #### Setting a number with leading zeroes -By default, PHPExcel will automatically detect the value type and set it to the appropriate Excel numeric datatype. This type conversion is handled by a value binder, as described in the section of this document entitled "Using value binders to facilitate data entry". +By default, PhpSpreadsheet will automatically detect the value type and set it to the appropriate Excel numeric datatype. This type conversion is handled by a value binder, as described in the section of this document entitled "Using value binders to facilitate data entry". Numbers don't have leading zeroes, so if you try to set a numeric value that does have leading zeroes (such as a telephone number) then these will be normally be lost as the value is cast to a number, so "01513789642" will be displayed as 1513789642. -There are two ways you can force PHPExcel to override this behaviour. +There are two ways you can force PhpSpreadsheet to override this behaviour. Firstly, you can set the datatype explicitly as a string so that it is not converted to a number. ```php -// Set cell A8 with a numeric value, but tell PHPExcel it should be treated as a string -$objPHPExcel->getActiveSheet()->setCellValueExplicit( - 'A8', +// Set cell A8 with a numeric value, but tell PhpSpreadsheet it should be treated as a string +$spreadsheet->getActiveSheet()->setCellValueExplicit( + 'A8', "01513789642", - PHPExcel_Cell_DataType::TYPE_STRING + \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING ); ``` @@ -102,9 +102,9 @@ Alternatively, you can use a number format mask to display the value with leadin ```php // Set cell A9 with a numeric value -$objPHPExcel->getActiveSheet()->setCellValue('A9', 1513789642); +$spreadsheet->getActiveSheet()->setCellValue('A9', 1513789642); // Set a number format mask to display the value as 11 digits with leading zeroes -$objPHPExcel->getActiveSheet()->getStyle('A9') +$spreadsheet->getActiveSheet()->getStyle('A9') ->getNumberFormat() ->setFormatCode( '00000000000' @@ -115,9 +115,9 @@ With number format masking, you can even break up the digits into groups to make ```php // Set cell A10 with a numeric value -$objPHPExcel->getActiveSheet()->setCellValue('A10', 1513789642); +$spreadsheet->getActiveSheet()->setCellValue('A10', 1513789642); // Set a number format mask to display the value as 11 digits with leading zeroes -$objPHPExcel->getActiveSheet()->getStyle('A10') +$spreadsheet->getActiveSheet()->getStyle('A10') ->getNumberFormat() ->setFormatCode( '0000-000-0000' @@ -141,7 +141,7 @@ $arrayData = array( array('Q3', 52, 61, 69), array('Q4', 30, 32, 0), ); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->fromArray( $arrayData, // The data to set NULL, // Array values with this value will not be set @@ -156,7 +156,7 @@ If you pass a 2-d array, then this will be treated as a series of rows and colum ```php $rowArray = array('Value1', 'Value2', 'Value3', 'Value4'); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->fromArray( $rowArray, // The data to set NULL, // Array values with this value will not be set @@ -172,7 +172,7 @@ If you have a simple 1-d array, and want to write it as a column, then the follo ```php $rowArray = array('Value1', 'Value2', 'Value3', 'Value4'); $columnArray = array_chunk($rowArray, 1); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->fromArray( $columnArray, // The data to set NULL, // Array values with this value will not be set @@ -189,7 +189,7 @@ To retrieve the value of a cell, the cell should first be retrieved from the wor ```php // Get the value fom cell A1 -$cellValue = $objPHPExcel->getActiveSheet()->getCell('A1') +$cellValue = $spreadsheet->getActiveSheet()->getCell('A1') ->getValue(); ``` @@ -199,7 +199,7 @@ If a cell contains a formula, and you need to retrieve the calculated value rath ```php // Get the value fom cell A4 -$cellValue = $objPHPExcel->getActiveSheet()->getCell('A4') +$cellValue = $spreadsheet->getActiveSheet()->getCell('A4') ->getCalculatedValue(); ``` @@ -207,7 +207,7 @@ Alternatively, if you want to see the value with any cell formatting applied (e. ```php // Get the value fom cell A6 -$cellValue = $objPHPExcel->getActiveSheet()->getCell('A6') +$cellValue = $spreadsheet->getActiveSheet()->getCell('A6') ->getFormattedValue(); ``` @@ -218,7 +218,7 @@ Setting a cell value by coordinate can be done using the worksheet's `setCellVal ```php // Set cell B5 with a string value -$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, 5, 'PHPExcel'); +$spreadsheet->getActiveSheet()->setCellValueByColumnAndRow(1, 5, 'PhpSpreadsheet'); ``` **Note** that column references start with '0' for column 'A', rather than from '1'. @@ -229,14 +229,14 @@ To retrieve the value of a cell, the cell should first be retrieved from the wor ```php // Get the value fom cell B5 -$cellValue = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(1, 5) +$cellValue = $spreadsheet->getActiveSheet()->getCellByColumnAndRow(1, 5) ->getValue(); ``` If you need the calculated value of a cell, use the following code. This is further explained in . ```php // Get the value fom cell A4 -$cellValue = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(0, 4) +$cellValue = $spreadsheet->getActiveSheet()->getCellByColumnAndRow(0, 4) ->getCalculatedValue(); ``` @@ -245,7 +245,7 @@ $cellValue = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(0, 4) It is also possible to retrieve a range of cell values to an array in a single call using the `toArray()`, `rangeToArray()` or `namedRangeToArray()` methods. ```php -$dataArray = $objPHPExcel->getActiveSheet() +$dataArray = $spreadsheet->getActiveSheet() ->rangeToArray( 'C3:E5', // The worksheet range that we want to retrieve NULL, // Value that should be returned for empty cells @@ -266,11 +266,11 @@ The easiest way to loop cells is by using iterators. Using iterators, one can us Below is an example where we read all the values in a worksheet and display them in a table. ```php -$objReader = PHPExcel_IOFactory::createReader('Xlsx'); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx'); $objReader->setReadDataOnly(TRUE); -$objPHPExcel = $objReader->load("test.xlsx"); +$spreadsheet = $objReader->load("test.xlsx"); -$objWorksheet = $objPHPExcel->getActiveSheet(); +$objWorksheet = $spreadsheet->getActiveSheet(); echo '' . PHP_EOL; foreach ($objWorksheet->getRowIterator() as $row) { @@ -278,11 +278,11 @@ foreach ($objWorksheet->getRowIterator() as $row) { $cellIterator = $row->getCellIterator(); $cellIterator->setIterateOnlyExistingCells(FALSE); // This loops through all cells, // even if a cell value is not set. - // By default, only cells that have a value + // By default, only cells that have a value // set will be iterated. foreach ($cellIterator as $cell) { - echo '' . PHP_EOL; } echo '' . PHP_EOL; @@ -299,28 +299,28 @@ Setting the cell iterator's setIterateOnlyExistingCells() to FALSE will loop all One can use the possibility to access cell values by column and row index like (0,1) instead of 'A1' for reading and writing cell values in loops. -Note: In PHPExcel column index is 0-based while row index is 1-based. That means 'A1' ~ (0,1) +Note: In PhpSpreadsheet column index is 0-based while row index is 1-based. That means 'A1' ~ (0,1) Below is an example where we read all the values in a worksheet and display them in a table. ```php -$objReader = PHPExcel_IOFactory::createReader('Xlsx'); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx'); $objReader->setReadDataOnly(TRUE); -$objPHPExcel = $objReader->load("test.xlsx"); +$spreadsheet = $objReader->load("test.xlsx"); -$objWorksheet = $objPHPExcel->getActiveSheet(); +$objWorksheet = $spreadsheet->getActiveSheet(); // Get the highest row and column numbers referenced in the worksheet $highestRow = $objWorksheet->getHighestRow(); // e.g. 10 $highestColumn = $objWorksheet->getHighestColumn(); // e.g 'F' -$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); // e.g. 5 +$highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($highestColumn); // e.g. 5 echo '
' . - $cell->getValue() . + echo '' . + $cell->getValue() . '
' . "\n"; for ($row = 1; $row <= $highestRow; ++$row) { echo '' . PHP_EOL; for ($col = 0; $col <= $highestColumnIndex; ++$col) { - echo '' . PHP_EOL; } echo '' . PHP_EOL; @@ -331,11 +331,11 @@ echo '
' . + echo '' . $objWorksheet->getCellByColumnAndRow($col, $row) - ->getValue() . + ->getValue() . '
' . PHP_EOL; Alternatively, you can take advantage of PHP's "Perl-style" character incrementors to loop through the cells by coordinate: ```php -$objReader = PHPExcel_IOFactory::createReader('Xlsx'); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx'); $objReader->setReadDataOnly(TRUE); -$objPHPExcel = $objReader->load("test.xlsx"); +$spreadsheet = $objReader->load("test.xlsx"); -$objWorksheet = $objPHPExcel->getActiveSheet(); +$objWorksheet = $spreadsheet->getActiveSheet(); // Get the highest row number and column letter referenced in the worksheet $highestRow = $objWorksheet->getHighestRow(); // e.g. 10 $highestColumn = $objWorksheet->getHighestColumn(); // e.g 'F' @@ -346,9 +346,9 @@ echo '' . "\n"; for ($row = 1; $row <= $highestRow; ++$row) { echo '' . PHP_EOL; for ($col = 'A'; $col != $highestColumn; ++$col) { - echo '' . PHP_EOL; } echo '' . PHP_EOL; @@ -360,31 +360,31 @@ Note that we can't use a <= comparison here, because 'AA' would match as <= 'B', ### Using value binders to facilitate data entry -Internally, PHPExcel uses a default PHPExcel_Cell_IValueBinder implementation (PHPExcel_Cell_DefaultValueBinder) to determine data types of entered data using a cell's `setValue()` method (the `setValueExplicit()` method bypasses this check). +Internally, PhpSpreadsheet uses a default \PhpOffice\PhpSpreadsheet\Cell\IValueBinder implementation (\PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder) to determine data types of entered data using a cell's `setValue()` method (the `setValueExplicit()` method bypasses this check). -Optionally, the default behaviour of PHPExcel can be modified, allowing easier data entry. For example, a PHPExcel_Cell_AdvancedValueBinder class is available. It automatically converts percentages, number in scientific format, and dates entered as strings to the correct format, also setting the cell's style information. The following example demonstrates how to set the value binder in PHPExcel: +Optionally, the default behaviour of PhpSpreadsheet can be modified, allowing easier data entry. For example, a \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder class is available. It automatically converts percentages, number in scientific format, and dates entered as strings to the correct format, also setting the cell's style information. The following example demonstrates how to set the value binder in PhpSpreadsheet: ```php -/** PHPExcel */ -require_once 'PHPExcel.php'; +/** PhpSpreadsheet */ +require_once 'src/Boostrap.php'; // Set value binder -PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() ); +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() ); -// Create new PHPExcel object -$objPHPExcel = new PHPExcel(); +// Create new Spreadsheet object +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // ... // Add some data, resembling some different data types -$objPHPExcel->getActiveSheet()->setCellValue('A4', 'Percentage value:'); +$spreadsheet->getActiveSheet()->setCellValue('A4', 'Percentage value:'); // Converts the string value to 0.1 and sets percentage cell style -$objPHPExcel->getActiveSheet()->setCellValue('B4', '10%'); +$spreadsheet->getActiveSheet()->setCellValue('B4', '10%'); -$objPHPExcel->getActiveSheet()->setCellValue('A5', 'Date/time value:'); +$spreadsheet->getActiveSheet()->setCellValue('A5', 'Date/time value:'); // Converts the string value to an Excel datestamp and sets the date format cell style -$objPHPExcel->getActiveSheet()->setCellValue('B5', '21 December 1983'); +$spreadsheet->getActiveSheet()->setCellValue('B5', '21 December 1983'); ``` -__Creating your own value binder is easy.__ -When advanced value binding is required, you can implement the PHPExcel_Cell_IValueBinder interface or extend the PHPExcel_Cell_DefaultValueBinder or PHPExcel_Cell_AdvancedValueBinder classes. +__Creating your own value binder is easy.__ +When advanced value binding is required, you can implement the \PhpOffice\PhpSpreadsheet\Cell\IValueBinder interface or extend the \PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder or \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder classes. diff --git a/docs/Overview/08-Recipes.md b/docs/Overview/08-Recipes.md index 004dac17..7ca846df 100644 --- a/docs/Overview/08-Recipes.md +++ b/docs/Overview/08-Recipes.md @@ -1,19 +1,19 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation -## PHPExcel recipes +## PhpSpreadsheet recipes -The following pages offer you some widely-used PHPExcel recipes. Please note that these do NOT offer complete documentation on specific PHPExcel API functions, but just a bump to get you started. If you need specific API functions, please refer to the API documentation. +The following pages offer you some widely-used PhpSpreadsheet recipes. Please note that these do NOT offer complete documentation on specific PhpSpreadsheet API functions, but just a bump to get you started. If you need specific API functions, please refer to the API documentation. -For example, REF _Ref191885321 \w \h 4.4.7 REF _Ref191885321 \h Setting a worksheet's page orientation and size covers setting a page orientation to A4. Other paper formats, like US Letter, are not covered in this document, but in the PHPExcel API documentation. +For example, REF _Ref191885321 \w \h 4.4.7 REF _Ref191885321 \h Setting a worksheet's page orientation and size covers setting a page orientation to A4. Other paper formats, like US Letter, are not covered in this document, but in the PhpSpreadsheet API documentation. ### Setting a spreadsheet's metadata -PHPExcel allows an easy way to set a spreadsheet's metadata, using document property accessors. Spreadsheet metadata can be useful for finding a specific document in a file repository or a document management system. For example Microsoft Sharepoint uses document metadata to search for a specific document in its document lists. +PhpSpreadsheet allows an easy way to set a spreadsheet's metadata, using document property accessors. Spreadsheet metadata can be useful for finding a specific document in a file repository or a document management system. For example Microsoft Sharepoint uses document metadata to search for a specific document in its document lists. Setting spreadsheet metadata is done as follows: ```php -$objPHPExcel->getProperties() +$spreadsheet->getProperties() ->setCreator("Maarten Balliauw") ->setLastModifiedBy("Maarten Balliauw") ->setTitle("Office 2007 XLSX Test Document") @@ -30,13 +30,13 @@ $objPHPExcel->getProperties() The following line of code sets the active sheet index to the first sheet: ```php -$objPHPExcel->setActiveSheetIndex(0); +$spreadsheet->setActiveSheetIndex(0); ``` You can also set the active sheet by its name/title ```php -$objPHPExcel->setActiveSheetIndexByName('DataSheet') +$spreadsheet->setActiveSheetIndexByName('DataSheet') ``` will change the currently active sheet to the worksheet called "DataSheet". @@ -45,54 +45,51 @@ will change the currently active sheet to the worksheet called "DataSheet". In Excel, dates and Times are stored as numeric values counting the number of days elapsed since 1900-01-01. For example, the date '2008-12-31' is represented as 39813. You can verify this in Microsoft Office Excel by entering that date in a cell and afterwards changing the number format to 'General' so the true numeric value is revealed. Likewise, '3:15 AM' is represented as 0.135417. -PHPExcel works with UST (Universal Standard Time) date and Time values, but does no internal conversions; so it is up to the developer to ensure that values passed to the date/time conversion functions are UST. +PhpSpreadsheet works with UST (Universal Standard Time) date and Time values, but does no internal conversions; so it is up to the developer to ensure that values passed to the date/time conversion functions are UST. Writing a date value in a cell consists of 2 lines of code. Select the method that suits you the best. Here are some examples: ```php -/* PHPExcel_Cell_AdvanceValueBinder required for this sample */ -require_once 'PHPExcel/Cell/AdvancedValueBinder.php'; // MySQL-like timestamp '2008-12-31' or date string -PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() ); +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() ); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->setCellValue('D1', '2008-12-31'); -$objPHPExcel->getActiveSheet()->getStyle('D1') +$spreadsheet->getActiveSheet()->getStyle('D1') ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); // PHP-time (Unix time) $time = gmmktime(0,0,0,12,31,2008); // int(1230681600) -$objPHPExcel->getActiveSheet() - ->setCellValue('D1', PHPExcel_Shared_Date::PHPToExcel($time)); -$objPHPExcel->getActiveSheet()->getStyle('D1') +$spreadsheet->getActiveSheet() + ->setCellValue('D1', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($time)); +$spreadsheet->getActiveSheet()->getStyle('D1') ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); // Excel-date/time -$objPHPExcel->getActiveSheet()->setCellValue('D1', 39813) -$objPHPExcel->getActiveSheet()->getStyle('D1') +$spreadsheet->getActiveSheet()->setCellValue('D1', 39813) +$spreadsheet->getActiveSheet()->getStyle('D1') ->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH); ``` -The above methods for entering a date all yield the same result. PHPExcel_Style_NumberFormat provides a lot of pre-defined date formats. +The above methods for entering a date all yield the same result. \PhpOffice\PhpSpreadsheet\Style\NumberFormat provides a lot of pre-defined date formats. -The PHPExcel_Shared_Date::PHPToExcel() method will also work with a PHP DateTime object. +The \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel() method will also work with a PHP DateTime object. Similarly, times (or date and time values) can be entered in the same fashion: just remember to use an appropriate format code. __Notes:__ See section "Using value binders to facilitate data entry" to learn more about the AdvancedValueBinder used in the first example. -In previous versions of PHPExcel up to and including 1.6.6, when a cell had a date-like number format code, it was possible to enter a date directly using an integer PHP-time without converting to Excel date format. Starting with PHPExcel 1.6.7 this is no longer supported. -Excel can also operate in a 1904-based calendar (default for workbooks saved on Mac). Normally, you do not have to worry about this when using PHPExcel. +Excel can also operate in a 1904-based calendar (default for workbooks saved on Mac). Normally, you do not have to worry about this when using PhpSpreadsheet. ### Write a formula into a cell -Inside the Excel file, formulas are always stored as they would appear in an English version of Microsoft Office Excel, and PHPExcel handles all formulae internally in this format. This means that the following rules hold: +Inside the Excel file, formulas are always stored as they would appear in an English version of Microsoft Office Excel, and PhpSpreadsheet handles all formulae internally in this format. This means that the following rules hold: - Decimal separator is '.' (period) - Function argument separator is ',' (comma) @@ -103,42 +100,42 @@ This is regardless of which language version of Microsoft Office Excel may have When the final workbook is opened by the user, Microsoft Office Excel will take care of displaying the formula according the applications language. Translation is taken care of by the application! -The following line of code writes the formula '=IF(C4>500,"profit","loss")' into the cell B8. Note that the formula must start with "=" to make PHPExcel recognise this as a formula. +The following line of code writes the formula '=IF(C4>500,"profit","loss")' into the cell B8. Note that the formula must start with "=" to make PhpSpreadsheet recognise this as a formula. ```php -$objPHPExcel->getActiveSheet()->setCellValue('B8','=IF(C4>500,"profit","loss")'); +$spreadsheet->getActiveSheet()->setCellValue('B8','=IF(C4>500,"profit","loss")'); ``` If you want to write a string beginning with an "=" character to a cell, then you should use the setCellValueExplicit() method. ```php -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->setCellValueExplicit( 'B8', '=IF(C4>500,"profit","loss")', - PHPExcel_Cell_DataType::TYPE_STRING + \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING ); ``` A cell's formula can be read again using the following line of code: ```php -$formula = $objPHPExcel->getActiveSheet()->getCell('B8')->getValue(); +$formula = $spreadsheet->getActiveSheet()->getCell('B8')->getValue(); ``` If you need the calculated value of a cell, use the following code. This is further explained in REF _Ref191885372 \w \h \* MERGEFORMAT 4.4.35. ```php -$value = $objPHPExcel->getActiveSheet()->getCell('B8')->getCalculatedValue(); +$value = $spreadsheet->getActiveSheet()->getCell('B8')->getCalculatedValue(); ``` ### Locale Settings for Formulae -Some localisation elements have been included in PHPExcel. You can set a locale by changing the settings. To set the locale to Russian you would use: +Some localisation elements have been included in PhpSpreadsheet. You can set a locale by changing the settings. To set the locale to Russian you would use: ```php $locale = 'ru'; -$validLocale = PHPExcel_Settings::setLocale($locale); +$validLocale = \PhpOffice\PhpSpreadsheet\Settings::setLocale($locale); if (!$validLocale) { echo 'Unable to set locale to '.$locale." - reverting to en_us
\n"; } @@ -149,16 +146,16 @@ If Russian language files aren't available, the `setLocale()` method will return Once you have set a locale, you can translate a formula from its internal English coding. ```php -$formula = $objPHPExcel->getActiveSheet()->getCell('B8')->getValue(); -$translatedFormula = PHPExcel_Calculation::getInstance()->_translateFormulaToLocale($formula); +$formula = $spreadsheet->getActiveSheet()->getCell('B8')->getValue(); +$translatedFormula = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_translateFormulaToLocale($formula); ``` You can also create a formula using the function names and argument separators appropriate to the defined locale; then translate it to English before setting the cell value: ```php $formula = '=????360(????(2010;2;5);????(2010;12;31);??????)'; -$internalFormula = PHPExcel_Calculation::getInstance()->translateFormulaToEnglish($formula); -$objPHPExcel->getActiveSheet()->setCellValue('B8',$internalFormula); +$internalFormula = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->translateFormulaToEnglish($formula); +$spreadsheet->getActiveSheet()->setCellValue('B8',$internalFormula); ``` Currently, formula translation only translates the function names, the constants TRUE and FALSE, and the function argument separators. @@ -188,11 +185,11 @@ At present, the following locale settings are supported: In Microsoft Office Excel you get a line break in a cell by hitting ALT+"Enter". When you do that, it automatically turns on "wrap text" for the cell. -Here is how to achieve this in PHPExcel: +Here is how to achieve this in PhpSpreadsheet: ```php -$objPHPExcel->getActiveSheet()->getCell('A1')->setValue("hello\nworld"); -$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true); +$spreadsheet->getActiveSheet()->getCell('A1')->setValue("hello\nworld"); +$spreadsheet->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true); ``` __Tip__ @@ -204,10 +201,9 @@ __Tip__ AdvancedValuebinder.php automatically turns on "wrap text" for the cell when it sees a newline character in a string that you are inserting in a cell. Just like Microsoft Office Excel. Try this: ```php -require_once 'PHPExcel/Cell/AdvancedValueBinder.php'; -PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() ); +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() ); -$objPHPExcel->getActiveSheet()->getCell('A1')->setValue("hello\nworld"); +$spreadsheet->getActiveSheet()->getCell('A1')->setValue("hello\nworld"); ``` Read more about AdvancedValueBinder.php elsewhere. @@ -217,10 +213,10 @@ Read more about AdvancedValueBinder.php elsewhere. You can set a cell's datatype explicitly by using the cell's setValueExplicit method, or the setCellValueExplicit method of a worksheet. Here's an example: ```php -$objPHPExcel->getActiveSheet()->getCell('A1') +$spreadsheet->getActiveSheet()->getCell('A1') ->setValueExplicit( - '25', - PHPExcel_Cell_DataType::TYPE_NUMERIC + '25', + \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC ); ``` @@ -229,15 +225,15 @@ $objPHPExcel->getActiveSheet()->getCell('A1') You can make a cell a clickable URL by setting its hyperlink property: ```php -$objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); -$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net'); +$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); +$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net'); ``` If you want to make a hyperlink to another worksheet/cell, use the following code: ```php -$objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); -$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl("sheet://'Sheetname'!A1"); +$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); +$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl("sheet://'Sheetname'!A1"); ``` ### Setting Printer Options for Excel files @@ -247,25 +243,25 @@ $objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl("sheet:// Setting a worksheet's page orientation and size can be done using the following lines of code: ```php -$objPHPExcel->getActiveSheet()->getPageSetup() - ->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); -$objPHPExcel->getActiveSheet()->getPageSetup() - ->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); +$spreadsheet->getActiveSheet()->getPageSetup() + ->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); +$spreadsheet->getActiveSheet()->getPageSetup() + ->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); ``` Note that there are additional page settings available. Please refer to the API documentation for all possible options. #### Page Setup: Scaling options -The page setup scaling options in PHPExcel relate directly to the scaling options in the "Page Setup" dialog as shown in the illustration. +The page setup scaling options in PhpSpreadsheet relate directly to the scaling options in the "Page Setup" dialog as shown in the illustration. -Default values in PHPExcel correspond to default values in MS Office Excel as shown in illustration +Default values in PhpSpreadsheet correspond to default values in MS Office Excel as shown in illustration ![08-page-setup-scaling-options.png](./images/08-page-setup-scaling-options.png "") method | initial value | calling method will trigger | Note --------------------|:-------------:|-----------------------------|------ - setFitToPage(...) | FALSE | - | + setFitToPage(...) | FALSE | - | setScale(...) | 100 | setFitToPage(FALSE) | setFitToWidth(...) | 1 | setFitToPage(TRUE) | value 0 means do-not-fit-to-width setFitToHeight(...) | 1 | setFitToPage(TRUE) | value 0 means do-not-fit-to-height @@ -275,23 +271,23 @@ Default values in PHPExcel correspond to default values in MS Office Excel as sh Here is how to fit to 1 page wide by infinite pages tall: ```php -$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToWidth(1); -$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(0); +$spreadsheet->getActiveSheet()->getPageSetup()->setFitToWidth(1); +$spreadsheet->getActiveSheet()->getPageSetup()->setFitToHeight(0); ``` As you can see, it is not necessary to call setFitToPage(TRUE) since setFitToWidth(...) and setFitToHeight(...) triggers this. -If you use setFitToWidth() you should in general also specify setFitToHeight() explicitly like in the example. Be careful relying on the initial values. This is especially true if you are upgrading from PHPExcel 1.7.0 to 1.7.1 where the default values for fit-to-height and fit-to-width changed from 0 to 1. +If you use setFitToWidth() you should in general also specify setFitToHeight() explicitly like in the example. Be careful relying on the initial values. #### Page margins To set page margins for a worksheet, use this code: ```php -$objPHPExcel->getActiveSheet()->getPageMargins()->setTop(1); -$objPHPExcel->getActiveSheet()->getPageMargins()->setRight(0.75); -$objPHPExcel->getActiveSheet()->getPageMargins()->setLeft(0.75); -$objPHPExcel->getActiveSheet()->getPageMargins()->setBottom(1); +$spreadsheet->getActiveSheet()->getPageMargins()->setTop(1); +$spreadsheet->getActiveSheet()->getPageMargins()->setRight(0.75); +$spreadsheet->getActiveSheet()->getPageMargins()->setLeft(0.75); +$spreadsheet->getActiveSheet()->getPageMargins()->setBottom(1); ``` Note that the margin values are specified in inches. @@ -303,8 +299,8 @@ Note that the margin values are specified in inches. To center a page horizontally/vertically, you can use the following code: ```php -$objPHPExcel->getActiveSheet()->getPageSetup()->setHorizontalCentered(true); -$objPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false); +$spreadsheet->getActiveSheet()->getPageSetup()->setHorizontalCentered(true); +$spreadsheet->getActiveSheet()->getPageSetup()->setVerticalCentered(false); ``` #### Setting the print header and footer of a worksheet @@ -312,10 +308,10 @@ $objPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false); Setting a worksheet's print header and footer can be done using the following lines of code: ```php -$objPHPExcel->getActiveSheet()->getHeaderFooter() +$spreadsheet->getActiveSheet()->getHeaderFooter() ->setOddHeader('&C&HPlease treat this document as confidential!'); -$objPHPExcel->getActiveSheet()->getHeaderFooter() - ->setOddFooter('&L&B' . $objPHPExcel->getProperties()->getTitle() . '&RPage &P of &N'); +$spreadsheet->getActiveSheet()->getHeaderFooter() + ->setOddFooter('&L&B' . $spreadsheet->getProperties()->getTitle() . '&RPage &P of &N'); ``` Substitution and formatting codes (starting with &) can be used inside headers and footers. There is no required order in which these codes must appear. @@ -364,20 +360,20 @@ Code | Meaning [^print-footer-image-footnote]: z ```php -$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing(); -$objDrawing->setName('PHPExcel logo'); -$objDrawing->setPath('./images/phpexcel_logo.gif'); +$objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); +$objDrawing->setName('PhpSpreadsheet logo'); +$objDrawing->setPath('./images/PhpSpreadsheet_logo.png'); $objDrawing->setHeight(36); -$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT); +$spreadsheet->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_LEFT); ``` __Tip__ -The above table of codes may seem overwhelming first time you are trying to figure out how to write some header or footer. Luckily, there is an easier way. Let Microsoft Office Excel do the work for you.For example, create in Microsoft Office Excel an xlsx file where you insert the header and footer as desired using the programs own interface. Save file as test.xlsx. Now, take that file and read off the values using PHPExcel as follows: +The above table of codes may seem overwhelming first time you are trying to figure out how to write some header or footer. Luckily, there is an easier way. Let Microsoft Office Excel do the work for you.For example, create in Microsoft Office Excel an xlsx file where you insert the header and footer as desired using the programs own interface. Save file as test.xlsx. Now, take that file and read off the values using PhpSpreadsheet as follows: ```php -$objPHPexcel = PHPExcel_IOFactory::load('test.xlsx'); -$objWorksheet = $objPHPexcel->getActiveSheet(); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('test.xlsx'); +$objWorksheet = $spreadsheet->getActiveSheet(); var_dump($objWorksheet->getHeaderFooter()->getOddFooter()); var_dump($objWorksheet->getHeaderFooter()->getEvenFooter()); @@ -392,27 +388,27 @@ That reveals the codes for the even/odd header and footer. Experienced users may To set a print break, use the following code, which sets a row break on row 10. ```php -$objPHPExcel->getActiveSheet()->setBreak( 'A10' , PHPExcel_Worksheet::BREAK_ROW ); +$spreadsheet->getActiveSheet()->setBreak( 'A10' , \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW ); ``` The following line of code sets a print break on column D: ```php -$objPHPExcel->getActiveSheet()->setBreak( 'D10' , PHPExcel_Worksheet::BREAK_COLUMN ); +$spreadsheet->getActiveSheet()->setBreak( 'D10' , \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN ); ``` #### Show/hide gridlines when printing To show/hide gridlines when printing, use the following code: -$objPHPExcel->getActiveSheet()->setShowGridlines(true); +$spreadsheet->getActiveSheet()->setShowGridlines(true); #### Setting rows/columns to repeat at top/left -PHPExcel can repeat specific rows/cells at top/left of a page. The following code is an example of how to repeat row 1 to 5 on each printed page of a specific worksheet: +PhpSpreadsheet can repeat specific rows/cells at top/left of a page. The following code is an example of how to repeat row 1 to 5 on each printed page of a specific worksheet: ```php -$objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 5); +$spreadsheet->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 5); ``` #### Specify printing area @@ -420,13 +416,13 @@ $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEn To specify a worksheet's printing area, use the following code: ```php -$objPHPExcel->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5'); +$spreadsheet->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5'); ``` There can also be multiple printing areas in a single worksheet: ```php -$objPHPExcel->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5,G4:M20'); +$spreadsheet->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5,G4:M20'); ``` ### Styles @@ -436,29 +432,29 @@ $objPHPExcel->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5,G4:M20'); A cell can be formatted with font, border, fill, ... style information. For example, one can set the foreground colour of a cell to red, aligned to the right, and the border to black and thick border style. Let's do that on cell B2: ```php -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_RED); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THICK); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THICK); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THICK); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THICK); -$objPHPExcel->getActiveSheet()->getStyle('B2') - ->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); -$objPHPExcel->getActiveSheet()->getStyle('B2') +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getBorders()->getTop()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getBorders()->getBottom()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getBorders()->getLeft()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getBorders()->getRight()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK); +$spreadsheet->getActiveSheet()->getStyle('B2') + ->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID); +$spreadsheet->getActiveSheet()->getStyle('B2') ->getFill()->getStartColor()->setARGB('FFFF0000'); ``` -Starting with PHPExcel 1.7.0 getStyle() also accepts a cell range as a parameter. For example, you can set a red background color on a range of cells: +`getStyle()` also accepts a cell range as a parameter. For example, you can set a red background color on a range of cells: ```php -$objPHPExcel->getActiveSheet()->getStyle('B3:B7')->getFill() - ->setFillType(PHPExcel_Style_Fill::FILL_SOLID) +$spreadsheet->getActiveSheet()->getStyle('B3:B7')->getFill() + ->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID) ->getStartColor()->setARGB('FFFF0000'); ``` @@ -473,15 +469,15 @@ $styleArray = array( 'bold' => true, ), 'alignment' => array( - 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT, + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, ), 'borders' => array( 'top' => array( - 'style' => PHPExcel_Style_Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, ), ), 'fill' => array( - 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, 'rotation' => 90, 'startcolor' => array( 'argb' => 'FFA0A0A0', @@ -492,13 +488,13 @@ $styleArray = array( ), ); -$objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray($styleArray); +$spreadsheet->getActiveSheet()->getStyle('A3')->applyFromArray($styleArray); ``` Or with a range of cells: ```php -$objPHPExcel->getActiveSheet()->getStyle('B3:B7')->applyFromArray($styleArray); +$spreadsheet->getActiveSheet()->getStyle('B3:B7')->applyFromArray($styleArray); ``` This alternative method using arrays should be faster in terms of execution whenever you are setting more than one style property. But the difference may barely be measurable unless you have many different styles in your workbook. @@ -511,11 +507,11 @@ You often want to format numbers in Excel. For example you may want a thousands In Microsoft Office Excel you may be familiar with selecting a number format from the "Format Cells" dialog. Here there are some predefined number formats available including some for dates. The dialog is designed in a way so you don't have to interact with the underlying raw number format code unless you need a custom number format. -In PHPExcel, you can also apply various predefined number formats. Example: +In PhpSpreadsheet, you can also apply various predefined number formats. Example: ```php -$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat() - ->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1); +$spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat() + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1); ``` This will format a number e.g. 1587.2 so it shows up as 1,587.20 when you open the workbook in MS Office Excel. (Depending on settings for decimal and thousands separators in Microsoft Office Excel it may show up as 1.587,20) @@ -523,34 +519,34 @@ This will format a number e.g. 1587.2 so it shows up as 1,587.20 when you open t You can achieve exactly the same as the above by using this: ```php -$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat() +$spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat() ->setFormatCode('#,##0.00'); ``` -In Microsoft Office Excel, as well as in PHPExcel, you will have to interact with raw number format codes whenever you need some special custom number format. Example: +In Microsoft Office Excel, as well as in PhpSpreadsheet, you will have to interact with raw number format codes whenever you need some special custom number format. Example: ```php -$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat() +$spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat() ->setFormatCode('[Blue][>=3000]$#,##0;[Red][<0]$#,##0;$#,##0'); ``` Another example is when you want numbers zero-padded with leading zeros to a fixed length: ```php -$objPHPExcel->getActiveSheet()->getCell('A1')->setValue(19); -$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat() +$spreadsheet->getActiveSheet()->getCell('A1')->setValue(19); +$spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat() ->setFormatCode('0000'); // will show as 0019 in Excel ``` __Tip__ The rules for composing a number format code in Excel can be rather complicated. Sometimes you know how to create some number format in Microsoft Office Excel, but don't know what the underlying number format code looks like. How do you find it? -The readers shipped with PHPExcel come to the rescue. Load your template workbook using e.g. Xlsx reader to reveal the number format code. Example how read a number format code for cell A1: +The readers shipped with PhpSpreadsheet come to the rescue. Load your template workbook using e.g. Xlsx reader to reveal the number format code. Example how read a number format code for cell A1: ```php -$objReader = PHPExcel_IOFactory::createReader('Xlsx'); -$objPHPExcel = $objReader->load('template.xlsx'); -var_dump($objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode()); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx'); +$spreadsheet = $objReader->load('template.xlsx'); +var_dump($spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode()); ``` Advanced users may find it faster to inspect the number format code directly by renaming template.xlsx to template.zip, unzipping, and looking for the relevant piece of XML code holding the number format code in *xl/styles.xml*. @@ -560,14 +556,14 @@ Advanced users may find it faster to inspect the number format code directly by Let's set vertical alignment to the top for cells A1:D4 ```php -$objPHPExcel->getActiveSheet()->getStyle('A1:D4') - ->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); +$spreadsheet->getActiveSheet()->getStyle('A1:D4') + ->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP); ``` Here is how to achieve wrap text: ```php -$objPHPExcel->getActiveSheet()->getStyle('A1:D4') +$spreadsheet->getActiveSheet()->getStyle('A1:D4') ->getAlignment()->setWrapText(true); ``` @@ -576,19 +572,19 @@ $objPHPExcel->getActiveSheet()->getStyle('A1:D4') It is possible to set the default style of a workbook. Let's set the default font to Arial size 8: ```php -$objPHPExcel->getDefaultStyle()->getFont()->setName('Arial'); -$objPHPExcel->getDefaultStyle()->getFont()->setSize(8); +$spreadsheet->getDefaultStyle()->getFont()->setName('Arial'); +$spreadsheet->getDefaultStyle()->getFont()->setSize(8); ``` #### Styling cell borders -In PHPExcel it is easy to apply various borders on a rectangular selection. Here is how to apply a thick red border outline around cells B2:G8. +In PhpSpreadsheet it is easy to apply various borders on a rectangular selection. Here is how to apply a thick red border outline around cells B2:G8. ```php $styleArray = array( 'borders' => array( 'outline' => array( - 'style' => PHPExcel_Style_Border::BORDER_THICK, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK, 'color' => array('argb' => 'FFFF0000'), ), ), @@ -627,7 +623,7 @@ An overview of all border shortcuts can be seen in the following image: ![08-styling-border-options.png](./images/08-styling-border-options.png "") -If you simultaneously set e.g. allborders and vertical, then we have "overlapping" borders, and one of the components has to win over the other where there is border overlap. In PHPExcel, from weakest to strongest borders, the list is as follows: allborders, outline/inside, vertical/horizontal, left/right/top/bottom/diagonal. +If you simultaneously set e.g. allborders and vertical, then we have "overlapping" borders, and one of the components has to win over the other where there is border overlap. In PhpSpreadsheet, from weakest to strongest borders, the list is as follows: allborders, outline/inside, vertical/horizontal, left/right/top/bottom/diagonal. This border hierarchy can be utilized to achieve various effects in an easy manner. @@ -638,34 +634,34 @@ A cell can be formatted conditionally, based on a specific rule. For example, on One can set a conditional style ruleset to a cell using the following code: ```php -$objConditional1 = new PHPExcel_Style_Conditional(); -$objConditional1->setConditionType(PHPExcel_Style_Conditional::CONDITION_CELLIS); -$objConditional1->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_LESSTHAN); +$objConditional1 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$objConditional1->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS); +$objConditional1->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN); $objConditional1->addCondition('0'); -$objConditional1->getStyle()->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_RED); +$objConditional1->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED); $objConditional1->getStyle()->getFont()->setBold(true); -$objConditional2 = new PHPExcel_Style_Conditional(); -$objConditional2->setConditionType(PHPExcel_Style_Conditional::CONDITION_CELLIS); -$objConditional2->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_GREATERTHANOREQUAL); +$objConditional2 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$objConditional2->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS); +$objConditional2->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL); $objConditional2->addCondition('0'); -$objConditional2->getStyle()->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_GREEN); +$objConditional2->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_GREEN); $objConditional2->getStyle()->getFont()->setBold(true); -$conditionalStyles = $objPHPExcel->getActiveSheet()->getStyle('B2')->getConditionalStyles(); +$conditionalStyles = $spreadsheet->getActiveSheet()->getStyle('B2')->getConditionalStyles(); array_push($conditionalStyles, $objConditional1); array_push($conditionalStyles, $objConditional2); -$objPHPExcel->getActiveSheet()->getStyle('B2')->setConditionalStyles($conditionalStyles); +$spreadsheet->getActiveSheet()->getStyle('B2')->setConditionalStyles($conditionalStyles); ``` If you want to copy the ruleset to other cells, you can duplicate the style object: ```php -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->duplicateStyle( - $objPHPExcel->getActiveSheet()->getStyle('B2'), - 'B3:B7' + $spreadsheet->getActiveSheet()->getStyle('B2'), + 'B3:B7' ); ``` @@ -674,17 +670,17 @@ $objPHPExcel->getActiveSheet() To add a comment to a cell, use the following code. The example below adds a comment to cell E11: ```php -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getComment('E11') ->setAuthor('Mark Baker'); -$objCommentRichText = $objPHPExcel->getActiveSheet() +$objCommentRichText = $spreadsheet->getActiveSheet() ->getComment('E11') - ->getText()->createTextRun('PHPExcel:'); + ->getText()->createTextRun('PhpSpreadsheet:'); $objCommentRichText->getFont()->setBold(true); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getComment('E11') ->getText()->createTextRun("\r\n"); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getComment('E11') ->getText()->createTextRun('Total amount on the current invoice, excluding VAT.'); ``` @@ -696,7 +692,7 @@ $objPHPExcel->getActiveSheet() To apply an autofilter to a range of cells, use the following code: ```php -$objPHPExcel->getActiveSheet()->setAutoFilter('A1:C9'); +$spreadsheet->getActiveSheet()->setAutoFilter('A1:C9'); ``` __Make sure that you always include the complete filter range!__ @@ -709,38 +705,38 @@ Excel offers 3 levels of "protection": document security, sheet security and cel Document security allows you to set a password on a complete spreadsheet, allowing changes to be made only when that password is entered.Worksheet security offers other security options: you can disallow inserting rows on a specific sheet, disallow sorting, ... Cell security offers the option to lock/unlock a cell as well as show/hide the internal formulaAn example on setting document security: ```php -$objPHPExcel->getSecurity()->setLockWindows(true); -$objPHPExcel->getSecurity()->setLockStructure(true); -$objPHPExcel->getSecurity()->setWorkbookPassword("PHPExcel"); +$spreadsheet->getSecurity()->setLockWindows(true); +$spreadsheet->getSecurity()->setLockStructure(true); +$spreadsheet->getSecurity()->setWorkbookPassword("PhpSpreadsheet"); ``` An example on setting worksheet security: ```php -$objPHPExcel->getActiveSheet() - ->getProtection()->setPassword('PHPExcel'); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() + ->getProtection()->setPassword('PhpSpreadsheet'); +$spreadsheet->getActiveSheet() ->getProtection()->setSheet(true); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getProtection()->setSort(true); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getProtection()->setInsertRows(true); -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->getProtection()->setFormatCells(true); ``` An example on setting cell security: ```php -$objPHPExcel->getActiveSheet()->getStyle('B1') +$spreadsheet->getActiveSheet()->getStyle('B1') ->getProtection() - ->setLocked(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); + ->setLocked(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); ``` __Make sure you enable worksheet protection if you need any of the worksheet protection features!__ This can be done using the following code: ```php -$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); +$spreadsheet->getActiveSheet()->getProtection()->setSheet(true); ``` ### Setting data validation on a cell @@ -750,10 +746,10 @@ Data validation is a powerful feature of Xlsx. It allows to specify an input fil The following piece of code only allows numbers between 10 and 20 to be entered in cell B3: ```php -$objValidation = $objPHPExcel->getActiveSheet()->getCell('B3') +$objValidation = $spreadsheet->getActiveSheet()->getCell('B3') ->getDataValidation(); -$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_WHOLE ); -$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP ); +$objValidation->setType( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE ); +$objValidation->setErrorStyle( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP ); $objValidation->setAllowBlank(true); $objValidation->setShowInputMessage(true); $objValidation->setShowErrorMessage(true); @@ -768,10 +764,10 @@ $objValidation->setFormula2(20); The following piece of code only allows an item picked from a list of data to be entered in cell B3: ```php -$objValidation = $objPHPExcel->getActiveSheet()->getCell('B5') +$objValidation = $spreadsheet->getActiveSheet()->getCell('B5') ->getDataValidation(); -$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST ); -$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION ); +$objValidation->setType( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST ); +$objValidation->setErrorStyle( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION ); $objValidation->setAllowBlank(false); $objValidation->setShowInputMessage(true); $objValidation->setShowErrorMessage(true); @@ -790,7 +786,7 @@ It is important to remember that any string participating in an Excel formula is If you need data validation on multiple cells, one can clone the ruleset: ```php -$objPHPExcel->getActiveSheet()->getCell('B8')->setDataValidation(clone $objValidation); +$spreadsheet->getActiveSheet()->getCell('B8')->setDataValidation(clone $objValidation); ``` ### Setting a column's width @@ -798,26 +794,26 @@ $objPHPExcel->getActiveSheet()->getCell('B8')->setDataValidation(clone $objValid A column's width can be set using the following code: ```php -$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(12); +$spreadsheet->getActiveSheet()->getColumnDimension('D')->setWidth(12); ``` -If you want PHPExcel to perform an automatic width calculation, use the following code. PHPExcel will approximate the column with to the width of the widest column value. +If you want PhpSpreadsheet to perform an automatic width calculation, use the following code. PhpSpreadsheet will approximate the column with to the width of the widest column value. ```php -$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); +$spreadsheet->getActiveSheet()->getColumnDimension('B')->setAutoSize(true); ``` ![08-column-width.png](./images/08-column-width.png "") -The measure for column width in PHPExcel does __not__ correspond exactly to the measure you may be used to in Microsoft Office Excel. Column widths are difficult to deal with in Excel, and there are several measures for the column width.1) __Inner width in character units__ (e.g. 8.43 this is probably what you are familiar with in Excel)2) __Full width in pixels__ (e.g. 64 pixels)3) __Full width in character units__ (e.g. 9.140625, value -1 indicates unset width)__PHPExcel always operates with 3) "Full width in character units"__ which is in fact the only value that is stored in any Excel file, hence the most reliable measure. Unfortunately, __Microsoft ____Office ____Excel does not present you with this ____measure__. Instead measures 1) and 2) are computed by the application when the file is opened and these values are presented in various dialogues and tool tips.The character width unit is the width of a '0' (zero) glyph in the workbooks default font. Therefore column widths measured in character units in two different workbooks can only be compared if they have the same default workbook font.If you have some Excel file and need to know the column widths in measure 3), you can read the Excel file with PHPExcel and echo the retrieved values. +The measure for column width in PhpSpreadsheet does __not__ correspond exactly to the measure you may be used to in Microsoft Office Excel. Column widths are difficult to deal with in Excel, and there are several measures for the column width.1) __Inner width in character units__ (e.g. 8.43 this is probably what you are familiar with in Excel)2) __Full width in pixels__ (e.g. 64 pixels)3) __Full width in character units__ (e.g. 9.140625, value -1 indicates unset width)__PHPExcel always operates with 3) "Full width in character units"__ which is in fact the only value that is stored in any Excel file, hence the most reliable measure. Unfortunately, __Microsoft ____Office ____Excel does not present you with this ____measure__. Instead measures 1) and 2) are computed by the application when the file is opened and these values are presented in various dialogues and tool tips.The character width unit is the width of a '0' (zero) glyph in the workbooks default font. Therefore column widths measured in character units in two different workbooks can only be compared if they have the same default workbook font.If you have some Excel file and need to know the column widths in measure 3), you can read the Excel file with PhpSpreadsheet and echo the retrieved values. ### Show/hide a column To set a worksheet's column visibility, you can use the following code. The first line explicitly shows the column C, the second line hides column D. ```php -$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setVisible(true); -$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false); +$spreadsheet->getActiveSheet()->getColumnDimension('C')->setVisible(true); +$spreadsheet->getActiveSheet()->getColumnDimension('D')->setVisible(false); ``` ### Group/outline a column @@ -825,22 +821,22 @@ $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false); To group/outline a column, you can use the following code: ```php -$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1); +$spreadsheet->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1); ``` You can also collapse the column. Note that you should also set the column invisible, otherwise the collapse will not be visible in Excel 2007. ```php -$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setCollapsed(true); -$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setVisible(false); +$spreadsheet->getActiveSheet()->getColumnDimension('E')->setCollapsed(true); +$spreadsheet->getActiveSheet()->getColumnDimension('E')->setVisible(false); ``` Please refer to the section "group/outline a row" for a complete example on collapsing. -You can instruct PHPExcel to add a summary to the right (default), or to the left. The following code adds the summary to the left: +You can instruct PhpSpreadsheet to add a summary to the right (default), or to the left. The following code adds the summary to the left: ```php -$objPHPExcel->getActiveSheet()->setShowSummaryRight(false); +$spreadsheet->getActiveSheet()->setShowSummaryRight(false); ``` ### Setting a row's height @@ -848,7 +844,7 @@ $objPHPExcel->getActiveSheet()->setShowSummaryRight(false); A row's height can be set using the following code: ```php -$objPHPExcel->getActiveSheet()->getRowDimension('10')->setRowHeight(100); +$spreadsheet->getActiveSheet()->getRowDimension('10')->setRowHeight(100); ``` Excel measures row height in points, where 1 pt is 1/72 of an inch (or about 0.35mm). The default value is 12.75 pts; and the permitted range of values is between 0 and 409 pts, where 0 pts is a hidden row. @@ -858,7 +854,7 @@ Excel measures row height in points, where 1 pt is 1/72 of an inch (or about 0.3 To set a worksheet''s row visibility, you can use the following code. The following example hides row number 10. ```php -$objPHPExcel->getActiveSheet()->getRowDimension('10')->setVisible(false); +$spreadsheet->getActiveSheet()->getRowDimension('10')->setVisible(false); ``` Note that if you apply active filters using an AutoFilter, then this will override any rows that you hide or unhide manually within that AutoFilter range if you save the file. @@ -868,36 +864,36 @@ Note that if you apply active filters using an AutoFilter, then this will overri To group/outline a row, you can use the following code: ```php -$objPHPExcel->getActiveSheet()->getRowDimension('5')->setOutlineLevel(1); +$spreadsheet->getActiveSheet()->getRowDimension('5')->setOutlineLevel(1); ``` You can also collapse the row. Note that you should also set the row invisible, otherwise the collapse will not be visible in Excel 2007. ```php -$objPHPExcel->getActiveSheet()->getRowDimension('5')->setCollapsed(true); -$objPHPExcel->getActiveSheet()->getRowDimension('5')->setVisible(false); +$spreadsheet->getActiveSheet()->getRowDimension('5')->setCollapsed(true); +$spreadsheet->getActiveSheet()->getRowDimension('5')->setVisible(false); ``` Here's an example which collapses rows 50 to 80: ```php for ($i = 51; $i <= 80; $i++) { - $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i"); - $objPHPExcel->getActiveSheet()->setCellValue('B' . $i, "LName $i"); - $objPHPExcel->getActiveSheet()->setCellValue('C' . $i, "PhoneNo $i"); - $objPHPExcel->getActiveSheet()->setCellValue('D' . $i, "FaxNo $i"); - $objPHPExcel->getActiveSheet()->setCellValue('E' . $i, true); - $objPHPExcel->getActiveSheet()->getRowDimension($i)->setOutlineLevel(1); - $objPHPExcel->getActiveSheet()->getRowDimension($i)->setVisible(false); + $spreadsheet->getActiveSheet()->setCellValue('A' . $i, "FName $i"); + $spreadsheet->getActiveSheet()->setCellValue('B' . $i, "LName $i"); + $spreadsheet->getActiveSheet()->setCellValue('C' . $i, "PhoneNo $i"); + $spreadsheet->getActiveSheet()->setCellValue('D' . $i, "FaxNo $i"); + $spreadsheet->getActiveSheet()->setCellValue('E' . $i, true); + $spreadsheet->getActiveSheet()->getRowDimension($i)->setOutlineLevel(1); + $spreadsheet->getActiveSheet()->getRowDimension($i)->setVisible(false); } -$objPHPExcel->getActiveSheet()->getRowDimension(81)->setCollapsed(true); +$spreadsheet->getActiveSheet()->getRowDimension(81)->setCollapsed(true); ``` -You can instruct PHPExcel to add a summary below the collapsible rows (default), or above. The following code adds the summary above: +You can instruct PhpSpreadsheet to add a summary below the collapsible rows (default), or above. The following code adds the summary above: ```php -$objPHPExcel->getActiveSheet()->setShowSummaryBelow(false); +$spreadsheet->getActiveSheet()->setShowSummaryBelow(false); ``` ### Merge/unmerge cells @@ -905,13 +901,13 @@ $objPHPExcel->getActiveSheet()->setShowSummaryBelow(false); If you have a big piece of data you want to display in a worksheet, you can merge two or more cells together, to become one cell. This can be done using the following code: ```php -$objPHPExcel->getActiveSheet()->mergeCells('A18:E22'); +$spreadsheet->getActiveSheet()->mergeCells('A18:E22'); ``` Removing a merge can be done using the unmergeCells method: ```php -$objPHPExcel->getActiveSheet()->unmergeCells('A18:E22'); +$spreadsheet->getActiveSheet()->unmergeCells('A18:E22'); ``` ### Inserting rows/columns @@ -919,25 +915,25 @@ $objPHPExcel->getActiveSheet()->unmergeCells('A18:E22'); You can insert/remove rows/columns at a specific position. The following code inserts 2 new rows, right before row 7: ```php -$objPHPExcel->getActiveSheet()->insertNewRowBefore(7, 2); +$spreadsheet->getActiveSheet()->insertNewRowBefore(7, 2); ``` ### Add a drawing to a worksheet -A drawing is always represented as a separate object, which can be added to a worksheet. Therefore, you must first instantiate a new PHPExcel_Worksheet_Drawing, and assign its properties a meaningful value: +A drawing is always represented as a separate object, which can be added to a worksheet. Therefore, you must first instantiate a new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing, and assign its properties a meaningful value: ```php -$objDrawing = new PHPExcel_Worksheet_Drawing(); +$objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $objDrawing->setName('Logo'); $objDrawing->setDescription('Logo'); $objDrawing->setPath('./images/officelogo.jpg'); $objDrawing->setHeight(36); ``` -To add the above drawing to the worksheet, use the following snippet of code. PHPExcel creates the link between the drawing and the worksheet: +To add the above drawing to the worksheet, use the following snippet of code. PhpSpreadsheet creates the link between the drawing and the worksheet: ```php -$objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); +$objDrawing->setWorksheet($spreadsheet->getActiveSheet()); ``` You can set numerous properties on a drawing, here are some examples: @@ -959,20 +955,20 @@ You can also add images created using GD functions without needing to save them // Use GD to create an in-memory image $gdImage = @imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream'); $textColor = imagecolorallocate($gdImage, 255, 255, 255); -imagestring($gdImage, 1, 5, 5, 'Created with PHPExcel', $textColor); +imagestring($gdImage, 1, 5, 5, 'Created with PhpSpreadsheet', $textColor); // Add the In-Memory image to a worksheet -$objDrawing = new PHPExcel_Worksheet_MemoryDrawing(); +$objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); $objDrawing->setName('In-Memory image 1'); $objDrawing->setDescription('In-Memory image 1'); $objDrawing->setCoordinates('A1'); $objDrawing->setImageResource($gdImage); $objDrawing->setRenderingFunction( - PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG + \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG ); -$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT); +$objDrawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_DEFAULT); $objDrawing->setHeight(36); -$objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); +$objDrawing->setWorksheet($spreadsheet->getActiveSheet()); ``` ### Reading Images from a worksheet @@ -983,8 +979,8 @@ The following code extracts images from the current active worksheet, and writes ```php $i = 0; -foreach ($objPHPExcel->getActiveSheet()->getDrawingCollection() as $drawing) { - if ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { +foreach ($spreadsheet->getActiveSheet()->getDrawingCollection() as $drawing) { + if ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { ob_start(); call_user_func( $drawing->getRenderingFunction(), @@ -993,14 +989,14 @@ foreach ($objPHPExcel->getActiveSheet()->getDrawingCollection() as $drawing) { $imageContents = ob_get_contents(); ob_end_clean(); switch ($drawing->getMimeType()) { - case PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG : - $extension = 'png'; + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_PNG : + $extension = 'png'; break; - case PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_GIF: - $extension = 'gif'; + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_GIF: + $extension = 'gif'; break; - case PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG : - $extension = 'jpg'; + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_JPEG : + $extension = 'jpg'; break; } } else { @@ -1019,36 +1015,36 @@ foreach ($objPHPExcel->getActiveSheet()->getDrawingCollection() as $drawing) { ### Add rich text to a cell -Adding rich text to a cell can be done using PHPExcel_RichText instances. Here''s an example, which creates the following rich text string: +Adding rich text to a cell can be done using \PhpOffice\PhpSpreadsheet\RichText instances. Here''s an example, which creates the following rich text string: > This invoice is *__payable within thirty days after the end of the month__* unless specified otherwise on the invoice. ```php -$objRichText = new PHPExcel_RichText(); +$objRichText = new \PhpOffice\PhpSpreadsheet\RichText(); $objRichText->createText('This invoice is '); $objPayable = $objRichText->createTextRun('payable within thirty days after the end of the month'); $objPayable->getFont()->setBold(true); $objPayable->getFont()->setItalic(true); -$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) ); +$objPayable->getFont()->setColor( new \PhpOffice\PhpSpreadsheet\Style\Color( \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_DARKGREEN ) ); $objRichText->createText(', unless specified otherwise on the invoice.'); -$objPHPExcel->getActiveSheet()->getCell('A18')->setValue($objRichText); +$spreadsheet->getActiveSheet()->getCell('A18')->setValue($objRichText); ``` ### Define a named range -PHPExcel supports the definition of named ranges. These can be defined using the following code: +PhpSpreadsheet supports the definition of named ranges. These can be defined using the following code: ```php // Add some data -$objPHPExcel->setActiveSheetIndex(0); -$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Firstname:'); -$objPHPExcel->getActiveSheet()->setCellValue('A2', 'Lastname:'); -$objPHPExcel->getActiveSheet()->setCellValue('B1', 'Maarten'); -$objPHPExcel->getActiveSheet()->setCellValue('B2', 'Balliauw'); +$spreadsheet->setActiveSheetIndex(0); +$spreadsheet->getActiveSheet()->setCellValue('A1', 'Firstname:'); +$spreadsheet->getActiveSheet()->setCellValue('A2', 'Lastname:'); +$spreadsheet->getActiveSheet()->setCellValue('B1', 'Maarten'); +$spreadsheet->getActiveSheet()->setCellValue('B2', 'Balliauw'); // Define named ranges -$objPHPExcel->addNamedRange( new PHPExcel_NamedRange('PersonFN', $objPHPExcel->getActiveSheet(), 'B1') ); -$objPHPExcel->addNamedRange( new PHPExcel_NamedRange('PersonLN', $objPHPExcel->getActiveSheet(), 'B2') ); +$spreadsheet->addNamedRange( new \PhpOffice\PhpSpreadsheet\NamedRange('PersonFN', $spreadsheet->getActiveSheet(), 'B1') ); +$spreadsheet->addNamedRange( new \PhpOffice\PhpSpreadsheet\NamedRange('PersonLN', $spreadsheet->getActiveSheet(), 'B2') ); ``` Optionally, a fourth parameter can be passed defining the named range local (i.e. only usable on the current worksheet). Named ranges are global by default. @@ -1057,13 +1053,13 @@ Optionally, a fourth parameter can be passed defining the named range local (i.e Sometimes, one really wants to output a file to a client''s browser, especially when creating spreadsheets on-the-fly. There are some easy steps that can be followed to do this: - 1. Create your PHPExcel spreadsheet + 1. Create your PhpSpreadsheet spreadsheet 2. Output HTTP headers for the type of document you wish to output - 3. Use the PHPExcel_Writer_* of your choice, and save to "php://output" + 3. Use the PHPExcel_Writer_* of your choice, and save to "php://output" -PHPExcel_Writer_Excel2007 uses temporary storage when writing to php://output. By default, temporary files are stored in the script's working directory. When there is no access, it falls back to the operating system's temporary files location. +\PhpOffice\PhpSpreadsheet\Writer\Xlsx uses temporary storage when writing to php://output. By default, temporary files are stored in the script's working directory. When there is no access, it falls back to the operating system's temporary files location. -__This may not be safe for unauthorized viewing!__ +__This may not be safe for unauthorized viewing!__ Depending on the configuration of your operating system, temporary storage can be read by anyone using the same temporary storage folder. When confidentiality of your document is needed, it is recommended not to use php://output. #### HTTP headers @@ -1071,34 +1067,34 @@ Depending on the configuration of your operating system, temporary storage can b Example of a script redirecting an Excel 2007 file to the client's browser: ```php -/* Here there will be some code where you create $objPHPExcel */ +/* Here there will be some code where you create $spreadsheet */ // redirect output to client browser header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="myfile.xlsx"'); header('Cache-Control: max-age=0'); -$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xlsx'); +$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); $objWriter->save('php://output'); ``` Example of a script redirecting an Xls file to the client's browser: ```php -/* Here there will be some code where you create $objPHPExcel */ +/* Here there will be some code where you create $spreadsheet */ // redirect output to client browser header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="myfile.xls"'); header('Cache-Control: max-age=0'); -$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xls'); +$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls'); $objWriter->save('php://output'); ``` **Caution:** -Make sure not to include any echo statements or output any other contents than the Excel file. There should be no whitespace before the opening tag (which can also be omitted to avoid problems). Make sure that your script is saved without a BOM (Byte-order mark) because this counts as echoing output. The same things apply to all included files. +Make sure not to include any echo statements or output any other contents than the Excel file. There should be no whitespace before the opening tag (which can also be omitted to avoid problems). Make sure that your script is saved without a BOM (Byte-order mark) because this counts as echoing output. The same things apply to all included files. Failing to follow the above guidelines may result in corrupt Excel files arriving at the client browser, and/or that headers cannot be set by PHP (resulting in warning messages). ### Setting the default column width @@ -1106,7 +1102,7 @@ Failing to follow the above guidelines may result in corrupt Excel files arrivin Default column width can be set using the following code: ```php -$objPHPExcel->getActiveSheet()->getDefaultColumnDimension()->setWidth(12); +$spreadsheet->getActiveSheet()->getDefaultColumnDimension()->setWidth(12); ``` ### Setting the default row height @@ -1114,12 +1110,12 @@ $objPHPExcel->getActiveSheet()->getDefaultColumnDimension()->setWidth(12); Default row height can be set using the following code: ```php -$objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(15); +$spreadsheet->getActiveSheet()->getDefaultRowDimension()->setRowHeight(15); ``` ### Add a GD drawing to a worksheet -There might be a situation where you want to generate an in-memory image using GD and add it to a PHPExcel worksheet without first having to save this file to a temporary location. +There might be a situation where you want to generate an in-memory image using GD and add it to a `Spreadsheet` without first having to save this file to a temporary location. Here''s an example which generates an image in memory and adds it to the active worksheet: @@ -1127,17 +1123,17 @@ Here''s an example which generates an image in memory and adds it to the active // Generate an image $gdImage = @imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream'); $textColor = imagecolorallocate($gdImage, 255, 255, 255); -imagestring($gdImage, 1, 5, 5, 'Created with PHPExcel', $textColor); +imagestring($gdImage, 1, 5, 5, 'Created with PhpSpreadsheet', $textColor); // Add a drawing to the worksheet -$objDrawing = new PHPExcel_Worksheet_MemoryDrawing(); +$objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); $objDrawing->setName('Sample image'); $objDrawing->setDescription('Sample image'); $objDrawing->setImageResource($gdImage); -$objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG); -$objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT); +$objDrawing->setRenderingFunction(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); +$objDrawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_DEFAULT); $objDrawing->setHeight(36); -$objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); +$objDrawing->setWorksheet($spreadsheet->getActiveSheet()); ``` ### Setting worksheet zoom level @@ -1145,7 +1141,7 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); To set a worksheet's zoom level, the following code can be used: ```php -$objPHPExcel->getActiveSheet()->getSheetView()->setZoomScale(75); +$spreadsheet->getActiveSheet()->getSheetView()->setZoomScale(75); ``` Note that zoom level should be in range 10 – 400. @@ -1163,7 +1159,7 @@ $objWorksheet->getTabColor()->setRGB('FF0000'); If you need to create more worksheets in the workbook, here is how: ```php -$objWorksheet1 = $objPHPExcel->createSheet(); +$objWorksheet1 = $spreadsheet->createSheet(); $objWorksheet1->setTitle('Another sheet'); ``` @@ -1174,15 +1170,15 @@ Think of createSheet() as the "Insert sheet" button in Excel. When you hit that Set a worksheet to be __hidden__ using this code: ```php -$objPHPExcel->getActiveSheet() - ->setSheetState(PHPExcel_Worksheet::SHEETSTATE_HIDDEN); +$spreadsheet->getActiveSheet() + ->setSheetState(\PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN); ``` Sometimes you may even want the worksheet to be __"very hidden"__. The available sheet states are : - - PHPExcel_Worksheet::SHEETSTATE_VISIBLE - - PHPExcel_Worksheet::SHEETSTATE_HIDDEN - - PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN + - \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE + - \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN + - \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN In Excel the sheet state "very hidden" can only be set programmatically, e.g. with Visual Basic Macro. It is not possible to make such a sheet visible via the user interface. @@ -1192,7 +1188,7 @@ Worksheets can be set individually whether column "A" should start at left or ri ```php // right-to-left worksheet -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->setRightToLeft(true); ``` diff --git a/docs/Overview/09-Calculation-Engine.md b/docs/Overview/09-Calculation-Engine.md index c13a18c6..a2186046 100644 --- a/docs/Overview/09-Calculation-Engine.md +++ b/docs/Overview/09-Calculation-Engine.md @@ -1,28 +1,28 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation -## Using the PHPExcel calculation engine +## Using the PhpSpreadsheet calculation engine ### Performing formula calculations -As PHPExcel represents an in-memory spreadsheet, it also offers formula calculation capabilities. A cell can be of a value type (containing a number or text), or a formula type (containing a formula which can be evaluated). For example, the formula "=SUM(A1:A10)" evaluates to the sum of values in A1, A2, ..., A10. +As PhpSpreadsheet represents an in-memory spreadsheet, it also offers formula calculation capabilities. A cell can be of a value type (containing a number or text), or a formula type (containing a formula which can be evaluated). For example, the formula "=SUM(A1:A10)" evaluates to the sum of values in A1, A2, ..., A10. To calculate a formula, you can call the cell containing the formula’s method getCalculatedValue(), for example: ```php -$objPHPExcel->getActiveSheet()->getCell('E11')->getCalculatedValue(); +$spreadsheet->getActiveSheet()->getCell('E11')->getCalculatedValue(); ``` -If you write the following line of code in the invoice demo included with PHPExcel, it evaluates to the value "64": +If you write the following line of code in the invoice demo included with PhpSpreadsheet, it evaluates to the value "64": ![09-command-line-calculation.png](./images/09-command-line-calculation.png "") -Another nice feature of PHPExcel's formula parser, is that it can automatically adjust a formula when inserting/removing rows/columns. Here's an example: +Another nice feature of PhpSpreadsheet's formula parser, is that it can automatically adjust a formula when inserting/removing rows/columns. Here's an example: ![09-formula-in-cell-1.png](./images/09-formula-in-cell-1.png "") You see that the formula contained in cell E11 is "SUM(E4:E9)". Now, when I write the following line of code, two new product lines are added: ```php -$objPHPExcel->getActiveSheet()->insertNewRowBefore(7, 2); +$spreadsheet->getActiveSheet()->insertNewRowBefore(7, 2); ``` ![09-formula-in-cell-2.png](./images/09-formula-in-cell-2.png "") @@ -31,11 +31,11 @@ Did you notice? The formula in the former cell E11 (now E13, as I inserted 2 new ### Known limitations -There are some known limitations to the PHPExcel calculation engine. Most of them are due to the fact that an Excel formula is converted into PHP code before being executed. This means that Excel formula calculation is subject to PHP's language characteristics. +There are some known limitations to the PhpSpreadsheet calculation engine. Most of them are due to the fact that an Excel formula is converted into PHP code before being executed. This means that Excel formula calculation is subject to PHP's language characteristics. #### Operator precedence -In Excel '+' wins over '&', just like '*' wins over '+' in ordinary algebra. The former rule is not what one finds using the calculation engine shipped with PHPExcel. +In Excel '+' wins over '&', just like '*' wins over '+' in ordinary algebra. The former rule is not what one finds using the calculation engine shipped with PhpSpreadsheet. Reference for operator precedence in Excel: [http://support.microsoft.com/kb/25189][18] diff --git a/docs/Overview/10-Reading-and-Writing.md b/docs/Overview/10-Reading-and-Writing.md index 5b62e9c3..e20ab08b 100644 --- a/docs/Overview/10-Reading-and-Writing.md +++ b/docs/Overview/10-Reading-and-Writing.md @@ -1,25 +1,25 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Reading and writing to file -As you already know from part REF _Ref191885438 \w \h 3.3 REF _Ref191885438 \h Readers and writers, reading and writing to a persisted storage is not possible using the base PHPExcel classes. For this purpose, PHPExcel provides readers and writers, which are implementations of PHPExcel_Writer_IReader and PHPExcel_Writer_IWriter. +As you already know from part REF _Ref191885438 \w \h 3.3 REF _Ref191885438 \h Readers and writers, reading and writing to a persisted storage is not possible using the base PhpSpreadsheet classes. For this purpose, PhpSpreadsheet provides readers and writers, which are implementations of PHPExcel_Writer_IReader and \PhpOffice\PhpSpreadsheet\Writer\IWriter. -### PHPExcel_IOFactory +### \PhpOffice\PhpSpreadsheet\IOFactory -The PHPExcel API offers multiple methods to create a PHPExcel_Writer_IReader or PHPExcel_Writer_IWriter instance: +The PhpSpreadsheet API offers multiple methods to create a PHPExcel_Writer_IReader or \PhpOffice\PhpSpreadsheet\Writer\IWriter instance: -Direct creation via PHPExcel_IOFactory. All examples underneath demonstrate the direct creation method. Note that you can also use the PHPExcel_IOFactory class to do this. +Direct creation via \PhpOffice\PhpSpreadsheet\IOFactory. All examples underneath demonstrate the direct creation method. Note that you can also use the \PhpOffice\PhpSpreadsheet\IOFactory class to do this. -#### Creating PHPExcel_Reader_IReader using PHPExcel_IOFactory +#### Creating \PhpOffice\PhpSpreadsheet\Reader\IReader using \PhpOffice\PhpSpreadsheet\IOFactory -There are 2 methods for reading in a file into PHPExcel: using automatic file type resolving or explicitly. +There are 2 methods for reading in a file into PhpSpreadsheet: using automatic file type resolving or explicitly. -Automatic file type resolving checks the different PHPExcel_Reader_IReader distributed with PHPExcel. If one of them can load the specified file name, the file is loaded using that PHPExcel_Reader_IReader. Explicit mode requires you to specify which PHPExcel_Reader_IReader should be used. +Automatic file type resolving checks the different \PhpOffice\PhpSpreadsheet\Reader\IReader distributed with PhpSpreadsheet. If one of them can load the specified file name, the file is loaded using that \PhpOffice\PhpSpreadsheet\Reader\IReader. Explicit mode requires you to specify which \PhpOffice\PhpSpreadsheet\Reader\IReader should be used. -You can create a PHPExcel_Reader_IReader instance using PHPExcel_IOFactory in automatic file type resolving mode using the following code sample: +You can create a \PhpOffice\PhpSpreadsheet\Reader\IReader instance using \PhpOffice\PhpSpreadsheet\IOFactory in automatic file type resolving mode using the following code sample: ```php -$objPHPExcel = PHPExcel_IOFactory::load("05featuredemo.xlsx"); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load("05featuredemo.xlsx"); ``` A typical use of this feature is when you need to read files uploaded by your users, and you don’t know whether they are uploading xls or xlsx files. @@ -27,42 +27,42 @@ A typical use of this feature is when you need to read files uploaded by your us If you need to set some properties on the reader, (e.g. to only read data, see more about this later), then you may instead want to use this variant: ```php -$objReader = PHPExcel_IOFactory::createReaderForFile("05featuredemo.xlsx"); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile("05featuredemo.xlsx"); $objReader->setReadDataOnly(true); $objReader->load("05featuredemo.xlsx"); ``` -You can create a PHPExcel_Reader_IReader instance using PHPExcel_IOFactory in explicit mode using the following code sample: +You can create a \PhpOffice\PhpSpreadsheet\Reader\IReader instance using \PhpOffice\PhpSpreadsheet\IOFactory in explicit mode using the following code sample: ```php -$objReader = PHPExcel_IOFactory::createReader("Xlsx"); -$objPHPExcel = $objReader->load("05featuredemo.xlsx"); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx"); +$spreadsheet = $objReader->load("05featuredemo.xlsx"); ``` Note that automatic type resolving mode is slightly slower than explicit mode. -#### Creating PHPExcel_Writer_IWriter using PHPExcel_IOFactory +#### Creating \PhpOffice\PhpSpreadsheet\Writer\IWriter using \PhpOffice\PhpSpreadsheet\IOFactory -You can create a PHPExcel_Writer_Iwriter instance using PHPExcel_IOFactory: +You can create a PHPExcel_Writer_Iwriter instance using \PhpOffice\PhpSpreadsheet\IOFactory: ```php -$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Xlsx"); +$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, "Xlsx"); $objWriter->save("05featuredemo.xlsx"); ``` ### Excel 2007 (SpreadsheetML) file format -Xlsx file format is the main file format of PHPExcel. It allows outputting the in-memory spreadsheet to a .xlsx file. +Xlsx file format is the main file format of PhpSpreadsheet. It allows outputting the in-memory spreadsheet to a .xlsx file. -#### PHPExcel_Reader_Excel2007 +#### \PhpOffice\PhpSpreadsheet\Reader\Xlsx ##### Reading a spreadsheet You can read an .xlsx file using the following code: ```php -$objReader = new PHPExcel_Reader_Excel2007(); -$objPHPExcel = $objReader->load("05featuredemo.xlsx"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); +$spreadsheet = $objReader->load("05featuredemo.xlsx"); ``` ##### Read data only @@ -70,9 +70,9 @@ $objPHPExcel = $objReader->load("05featuredemo.xlsx"); You can set the option setReadDataOnly on the reader, to instruct the reader to ignore styling, data validation, … and just read cell data: ```php -$objReader = new PHPExcel_Reader_Excel2007(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $objReader->setReadDataOnly(true); -$objPHPExcel = $objReader->load("05featuredemo.xlsx"); +$spreadsheet = $objReader->load("05featuredemo.xlsx"); ``` ##### Read specific sheets only @@ -80,19 +80,19 @@ $objPHPExcel = $objReader->load("05featuredemo.xlsx"); You can set the option setLoadSheetsOnly on the reader, to instruct the reader to only load the sheets with a given name: ```php -$objReader = new PHPExcel_Reader_Excel2007(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $objReader->setLoadSheetsOnly( array("Sheet 1", "My special sheet") ); -$objPHPExcel = $objReader->load("05featuredemo.xlsx"); +$spreadsheet = $objReader->load("05featuredemo.xlsx"); ``` ##### Read specific cells only -You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements PHPExcel_Reader_IReadFilter. By default, all cells are read using the PHPExcel_Reader_DefaultReadFilter. +You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. The following code will only read row 1 and rows 20 – 30 of any sheet in the Excel file: ```php -class MyReadFilter implements PHPExcel_Reader_IReadFilter { +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read title row and rows 20 - 30 @@ -103,19 +103,19 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter { } } -$objReader = new PHPExcel_Reader_Excel2007(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $objReader->setReadFilter( new MyReadFilter() ); -$objPHPExcel = $objReader->load("06largescale.xlsx"); +$spreadsheet = $objReader->load("06largescale.xlsx"); ``` -#### PHPExcel_Writer_Excel2007 +#### \PhpOffice\PhpSpreadsheet\Writer\Xlsx ##### Writing a spreadsheet You can write an .xlsx file using the following code: ```php -$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet); $objWriter->save("05featuredemo.xlsx"); ``` @@ -124,7 +124,7 @@ $objWriter->save("05featuredemo.xlsx"); By default, this writer pre-calculates all formulas in the spreadsheet. This can be slow on large spreadsheets, and maybe even unwanted. You can however disable formula pre-calculation: ```php -$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet); $objWriter->setPreCalculateFormulas(false); $objWriter->save("05featuredemo.xlsx"); ``` @@ -134,7 +134,7 @@ $objWriter->save("05featuredemo.xlsx"); Because of a bug in the Office2003 compatibility pack, there can be some small issues when opening Xlsx spreadsheets (mostly related to formula calculation). You can enable Office2003 compatibility with the following code: ``` -$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet); $objWriter->setOffice2003Compatibility(true); $objWriter->save("05featuredemo.xlsx"); ``` @@ -144,22 +144,22 @@ Office2003 compatibility option should only be used when needed. This option dis ### Excel 5 (BIFF) file format -Xls file format is the old Excel file format, implemented in PHPExcel to provide a uniform manner to create both .xlsx and .xls files. It is basically a modified version of [PEAR Spreadsheet_Excel_Writer][21], although it has been extended and has fewer limitations and more features than the old PEAR library. This can read all BIFF versions that use OLE2: BIFF5 (introduced with office 95) through BIFF8, but cannot read earlier versions. +Xls file format is the old Excel file format, implemented in PhpSpreadsheet to provide a uniform manner to create both .xlsx and .xls files. It is basically a modified version of [PEAR Spreadsheet_Excel_Writer][21], although it has been extended and has fewer limitations and more features than the old PEAR library. This can read all BIFF versions that use OLE2: BIFF5 (introduced with office 95) through BIFF8, but cannot read earlier versions. -Xls file format will not be developed any further, it just provides an additional file format for PHPExcel. +Xls file format will not be developed any further, it just provides an additional file format for PhpSpreadsheet. __Excel5 (BIFF) limitations__ Please note that BIFF file format has some limits regarding to styling cells and handling large spreadsheets via PHP. -#### PHPExcel_Reader_Excel5 +#### \PhpOffice\PhpSpreadsheet\Reader\Xls ##### Reading a spreadsheet You can read an .xls file using the following code: ```php -$objReader = new PHPExcel_Reader_Excel5(); -$objPHPExcel = $objReader->load("05featuredemo.xls"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); +$spreadsheet = $objReader->load("05featuredemo.xls"); ``` ##### Read data only @@ -167,9 +167,9 @@ $objPHPExcel = $objReader->load("05featuredemo.xls"); You can set the option setReadDataOnly on the reader, to instruct the reader to ignore styling, data validation, … and just read cell data: ```php -$objReader = new PHPExcel_Reader_Excel5(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); $objReader->setReadDataOnly(true); -$objPHPExcel = $objReader->load("05featuredemo.xls"); +$spreadsheet = $objReader->load("05featuredemo.xls"); ``` ##### Read specific sheets only @@ -177,19 +177,19 @@ $objPHPExcel = $objReader->load("05featuredemo.xls"); You can set the option setLoadSheetsOnly on the reader, to instruct the reader to only load the sheets with a given name: ```php -$objReader = new PHPExcel_Reader_Excel5(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); $objReader->setLoadSheetsOnly( array("Sheet 1", "My special sheet") ); -$objPHPExcel = $objReader->load("05featuredemo.xls"); +$spreadsheet = $objReader->load("05featuredemo.xls"); ``` ##### Read specific cells only -You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements PHPExcel_Reader_IReadFilter. By default, all cells are read using the PHPExcel_Reader_DefaultReadFilter. +You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. The following code will only read row 1 and rows 20 to 30 of any sheet in the Excel file: ```php -class MyReadFilter implements PHPExcel_Reader_IReadFilter { +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read title row and rows 20 - 30 @@ -200,19 +200,19 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter { } } -$objReader = new PHPExcel_Reader_Excel5(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); $objReader->setReadFilter( new MyReadFilter() ); -$objPHPExcel = $objReader->load("06largescale.xls"); +$spreadsheet = $objReader->load("06largescale.xls"); ``` -#### PHPExcel_Writer_Excel5 +#### \PhpOffice\PhpSpreadsheet\Writer\Xls ##### Writing a spreadsheet You can write an .xls file using the following code: ```php -$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xls($spreadsheet); $objWriter->save("05featuredemo.xls"); ``` @@ -223,25 +223,25 @@ Excel 2003 XML file format is a file format which can be used in older versions __Excel 2003 XML limitations__ Please note that Excel 2003 XML format has some limits regarding to styling cells and handling large spreadsheets via PHP. -#### PHPExcel_Reader_Excel2003XML +#### \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML ##### Reading a spreadsheet You can read an Excel 2003 .xml file using the following code: ```php -$objReader = new PHPExcel_Reader_Excel2003XML(); -$objPHPExcel = $objReader->load("05featuredemo.xml"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML(); +$spreadsheet = $objReader->load("05featuredemo.xml"); ``` ##### Read specific cells only -You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements PHPExcel_Reader_IReadFilter. By default, all cells are read using the PHPExcel_Reader_DefaultReadFilter. +You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. The following code will only read row 1 and rows 20 to 30 of any sheet in the Excel file: ```php -class MyReadFilter implements PHPExcel_Reader_IReadFilter { +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read title row and rows 20 - 30 @@ -253,9 +253,9 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter { } -$objReader = new PHPExcel_Reader_Excel2003XML(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML(); $objReader->setReadFilter( new MyReadFilter() ); -$objPHPExcel = $objReader->load("06largescale.xml"); +$spreadsheet = $objReader->load("06largescale.xml"); ``` ### Symbolic LinK (SYLK) @@ -265,25 +265,25 @@ Symbolic Link (SYLK) is a Microsoft file format typically used to exchange data __SYLK limitations__ Please note that SYLK file format has some limits regarding to styling cells and handling large spreadsheets via PHP. -#### PHPExcel_Reader_SYLK +#### \PhpOffice\PhpSpreadsheet\Reader\SYLK ##### Reading a spreadsheet You can read an .slk file using the following code: ```php -$objReader = new PHPExcel_Reader_SYLK(); -$objPHPExcel = $objReader->load("05featuredemo.slk"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\SYLK(); +$spreadsheet = $objReader->load("05featuredemo.slk"); ``` ##### Read specific cells only -You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements PHPExcel_Reader_IReadFilter. By default, all cells are read using the PHPExcel_Reader_DefaultReadFilter. +You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. The following code will only read row 1 and rows 20 to 30 of any sheet in the SYLK file: ```php -class MyReadFilter implements PHPExcel_Reader_IReadFilter { +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read title row and rows 20 - 30 @@ -295,34 +295,34 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter { } -$objReader = new PHPExcel_Reader_SYLK(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\SYLK(); $objReader->setReadFilter( new MyReadFilter() ); -$objPHPExcel = $objReader->load("06largescale.slk"); +$spreadsheet = $objReader->load("06largescale.slk"); ``` ### Open/Libre Office (.ods) Open Office or Libre Office .ods files are the standard file format for Open Office or Libre Office Calc files. -#### PHPExcel_Reader_OOCalc +#### \PhpOffice\PhpSpreadsheet\Reader\Ods ##### Reading a spreadsheet You can read an .ods file using the following code: ```php -$objReader = new PHPExcel_Reader_OOCalc(); -$objPHPExcel = $objReader->load("05featuredemo.ods"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Ods(); +$spreadsheet = $objReader->load("05featuredemo.ods"); ``` ##### Read specific cells only -You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements PHPExcel_Reader_IReadFilter. By default, all cells are read using the PHPExcel_Reader_DefaultReadFilter. +You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. The following code will only read row 1 and rows 20 to 30 of any sheet in the Calc file: ```php -class MyReadFilter implements PHPExcel_Reader_IReadFilter { +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read title row and rows 20 - 30 @@ -336,42 +336,42 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter { $objReader = new PHPExcel_Reader_OOcalc(); $objReader->setReadFilter( new MyReadFilter() ); -$objPHPExcel = $objReader->load("06largescale.ods"); +$spreadsheet = $objReader->load("06largescale.ods"); ``` ### CSV (Comma Separated Values) -CSV (Comma Separated Values) are often used as an import/export file format with other systems. PHPExcel allows reading and writing to CSV files. +CSV (Comma Separated Values) are often used as an import/export file format with other systems. PhpSpreadsheet allows reading and writing to CSV files. __CSV limitations__ Please note that CSV file format has some limits regarding to styling cells, number formatting, ... -#### PHPExcel_Reader_CSV +#### \PhpOffice\PhpSpreadsheet\Reader\CSV ##### Reading a CSV file You can read a .csv file using the following code: ```php -$objReader = new PHPExcel_Reader_CSV(); -$objPHPExcel = $objReader->load("sample.csv"); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\CSV(); +$spreadsheet = $objReader->load("sample.csv"); ``` ##### Setting CSV options -Often, CSV files are not really “comma separated”, or use semicolon (;) as a separator. You can instruct PHPExcel_Reader_CSV some options before reading a CSV file. +Often, CSV files are not really “comma separated”, or use semicolon (;) as a separator. You can instruct \PhpOffice\PhpSpreadsheet\Reader\CSV some options before reading a CSV file. -Note that PHPExcel_Reader_CSV by default assumes that the loaded CSV file is UTF-8 encoded. If you are reading CSV files that were created in Microsoft Office Excel the correct input encoding may rather be Windows-1252 (CP1252). Always make sure that the input encoding is set appropriately. +Note that \PhpOffice\PhpSpreadsheet\Reader\CSV by default assumes that the loaded CSV file is UTF-8 encoded. If you are reading CSV files that were created in Microsoft Office Excel the correct input encoding may rather be Windows-1252 (CP1252). Always make sure that the input encoding is set appropriately. ```php -$objReader = new PHPExcel_Reader_CSV(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\CSV(); $objReader->setInputEncoding('CP1252'); $objReader->setDelimiter(';'); $objReader->setEnclosure(''); $objReader->setLineEnding("\r\n"); $objReader->setSheetIndex(0); -$objPHPExcel = $objReader->load("sample.csv"); +$spreadsheet = $objReader->load("sample.csv"); ``` ##### Read a specific worksheet @@ -384,35 +384,35 @@ $objReader->setSheetIndex(0); ##### Read into existing spreadsheet -When working with CSV files, it might occur that you want to import CSV data into an existing PHPExcel object. The following code loads a CSV file into an existing $objPHPExcel containing some sheets, and imports onto the 6th sheet: +When working with CSV files, it might occur that you want to import CSV data into an existing `Spreadsheet` object. The following code loads a CSV file into an existing $spreadsheet containing some sheets, and imports onto the 6th sheet: ```php -$objReader = new PHPExcel_Reader_CSV(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\CSV(); $objReader->setDelimiter(';'); $objReader->setEnclosure(''); $objReader->setLineEnding("\r\n"); -$objReader->setSheetIndex(5); +$objReader->setSheetIndex(5); -$objReader->loadIntoExisting("05featuredemo.csv", $objPHPExcel); +$objReader->loadIntoExisting("05featuredemo.csv", $spreadsheet); ``` -#### PHPExcel_Writer_CSV +#### \PhpOffice\PhpSpreadsheet\Writer\CSV ##### Writing a CSV file You can write a .csv file using the following code: ```php -$objWriter = new PHPExcel_Writer_CSV($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\CSV($spreadsheet); $objWriter->save("05featuredemo.csv"); ``` ##### Setting CSV options -Often, CSV files are not really “comma separated”, or use semicolon (;) as a separator. You can instruct PHPExcel_Writer_CSV some options before writing a CSV file: +Often, CSV files are not really “comma separated”, or use semicolon (;) as a separator. You can instruct \PhpOffice\PhpSpreadsheet\Writer\CSV some options before writing a CSV file: ```php -$objWriter = new PHPExcel_Writer_CSV($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\CSV($spreadsheet); $objWriter->setDelimiter(';'); $objWriter->setEnclosure(''); $objWriter->setLineEnding("\r\n"); @@ -434,7 +434,7 @@ $objWriter->setSheetIndex(0); By default, this writer pre-calculates all formulas in the spreadsheet. This can be slow on large spreadsheets, and maybe even unwanted. You can however disable formula pre-calculation: ```php -$objWriter = new PHPExcel_Writer_CSV($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\CSV($spreadsheet); $objWriter->setPreCalculateFormulas(false); $objWriter->save("05featuredemo.csv"); ``` @@ -444,7 +444,7 @@ $objWriter->save("05featuredemo.csv"); A CSV file can be marked as UTF-8 by writing a BOM file header. This can be enabled by using the following code: ```php -$objWriter = new PHPExcel_Writer_CSV($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\CSV($spreadsheet); $objWriter->setUseBOM(true); $objWriter->save("05featuredemo.csv"); ``` @@ -453,56 +453,56 @@ $objWriter->save("05featuredemo.csv"); If the worksheet you are exporting contains numbers with decimal or thousands separators then you should think about what characters you want to use for those before doing the export. -By default PHPExcel looks up in the server's locale settings to decide what characters to use. But to avoid problems it is recommended to set the characters explicitly as shown below. +By default PhpSpreadsheet looks up in the server's locale settings to decide what characters to use. But to avoid problems it is recommended to set the characters explicitly as shown below. English users will want to use this before doing the export: ```php -PHPExcel_Shared_String::setDecimalSeparator('.'); -PHPExcel_Shared_String::setThousandsSeparator(','); +\PhpOffice\PhpSpreadsheet\Shared\StringHelper::setDecimalSeparator('.'); +\PhpOffice\PhpSpreadsheet\Shared\StringHelper::setThousandsSeparator(','); ``` German users will want to use the opposite values. ```php -PHPExcel_Shared_String::setDecimalSeparator(','); -PHPExcel_Shared_String::setThousandsSeparator('.'); +\PhpOffice\PhpSpreadsheet\Shared\StringHelper::setDecimalSeparator(','); +\PhpOffice\PhpSpreadsheet\Shared\StringHelper::setThousandsSeparator('.'); ``` Note that the above code sets decimal and thousand separators as global options. This also affects how HTML and PDF is exported. ### HTML -PHPExcel allows you to read or write a spreadsheet as HTML format, for quick representation of the data in it to anyone who does not have a spreadsheet application on their PC, or loading files saved by other scripts that simply create HTML markup and give it a .xls file extension. +PhpSpreadsheet allows you to read or write a spreadsheet as HTML format, for quick representation of the data in it to anyone who does not have a spreadsheet application on their PC, or loading files saved by other scripts that simply create HTML markup and give it a .xls file extension. __HTML limitations__ Please note that HTML file format has some limits regarding to styling cells, number formatting, ... -#### PHPExcel_Reader_HTML +#### \PhpOffice\PhpSpreadsheet\Reader\HTML ##### Reading a spreadsheet You can read an .html or .htm file using the following code: ```php -$objReader = new PHPExcel_Reader_HTML(); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\HTML(); -$objPHPExcel = $objReader->load("05featuredemo.html"); +$spreadsheet = $objReader->load("05featuredemo.html"); ``` __HTML limitations__ Please note that HTML reader is still experimental and does not yet support merged cells or nested tables cleanly -#### PHPExcel_Writer_HTML +#### \PhpOffice\PhpSpreadsheet\Writer\HTML -Please note that PHPExcel_Writer_HTML only outputs the first worksheet by default. +Please note that \PhpOffice\PhpSpreadsheet\Writer\HTML only outputs the first worksheet by default. ##### Writing a spreadsheet You can write a .htm file using the following code: ```php -$objWriter = new PHPExcel_Writer_HTML($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\HTML($spreadsheet); $objWriter->save("05featuredemo.htm"); ``` @@ -525,9 +525,9 @@ $objWriter->setSheetIndex(0); ##### Setting the images root of the HTML file -There might be situations where you want to explicitly set the included images root. For example, one might want to see +There might be situations where you want to explicitly set the included images root. For example, one might want to see ```html - + ``` instead of @@ -547,7 +547,7 @@ $objWriter->setImagesRoot('http://www.example.com'); By default, this writer pre-calculates all formulas in the spreadsheet. This can be slow on large spreadsheets, and maybe even unwanted. You can however disable formula pre-calculation: ```php -$objWriter = new PHPExcel_Writer_HTML($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\HTML($spreadsheet); $objWriter->setPreCalculateFormulas(false); $objWriter->save("05featuredemo.htm"); @@ -555,7 +555,7 @@ $objWriter->save("05featuredemo.htm"); ##### Embedding generated HTML in a web page -There might be a situation where you want to embed the generated HTML in an existing website. PHPExcel_Writer_HTML provides support to generate only specific parts of the HTML code, which allows you to use these parts in your website. +There might be a situation where you want to embed the generated HTML in an existing website. \PhpOffice\PhpSpreadsheet\Writer\HTML provides support to generate only specific parts of the HTML code, which allows you to use these parts in your website. Supported methods: @@ -568,7 +568,7 @@ Here's an example which retrieves all parts independently and merges them into a ```php generateHTMLHeader(); ?> @@ -598,7 +598,7 @@ echo $objWriter->generateHTMLFooter(); A HTML file can be marked as UTF-8 by writing a BOM file header. This can be enabled by using the following code: ```php -$objWriter = new PHPExcel_Writer_HTML($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\HTML($spreadsheet); $objWriter->setUseBOM(true); $objWriter->save("05featuredemo.htm"); @@ -606,22 +606,22 @@ $objWriter->save("05featuredemo.htm"); ##### Decimal and thousands separators -See section PHPExcel_Writer_CSV how to control the appearance of these. +See section \PhpOffice\PhpSpreadsheet\Writer\CSV how to control the appearance of these. ### PDF -PHPExcel allows you to write a spreadsheet into PDF format, for fast distribution of represented data. +PhpSpreadsheet allows you to write a spreadsheet into PDF format, for fast distribution of represented data. __PDF limitations__ Please note that PDF file format has some limits regarding to styling cells, number formatting, ... -#### PHPExcel_Writer_PDF +#### \PhpOffice\PhpSpreadsheet\Writer\PDF -PHPExcel’s PDF Writer is a wrapper for a 3rd-Party PDF Rendering library such as tcPDF, mPDF or DomPDF. Prior to version 1.7.8 of PHPExcel, the tcPDF library was bundled with PHPExcel; but from version 1.7.8 this was removed. Instead, you must now install a PDF Rendering library yourself; but PHPExcel will work with a number of different libraries. +PhpSpreadsheet’s PDF Writer is a wrapper for a 3rd-Party PDF Rendering library such as tcPDF, mPDF or DomPDF. You must now install a PDF Rendering library yourself; but PhpSpreadsheet will work with a number of different libraries. Currently, the following libraries are supported: -Library | Version used for testing | Downloadable from | PHPExcel Internal Constant +Library | Version used for testing | Downloadable from | PhpSpreadsheet Internal Constant --------|--------------------------|----------------------------------|---------------------------- tcPDF | 5.9 | http://www.tcpdf.org/ | PDF_RENDERER_TCPDF mPDF | 5.4 | http://www.mpdf1.com/mpdf/ | PDF_RENDERER_MPDF @@ -632,11 +632,11 @@ The different libraries have different strengths and weaknesses. Some generate b Before instantiating a Writer to generate PDF output, you will need to indicate which Rendering library you are using, and where it is located. ```php -$rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; $rendererLibrary = 'mPDF5.4'; $rendererLibraryPath = dirname(__FILE__).'/../../../libraries/PDF/' . $rendererLibrary; -if (!PHPExcel_Settings::setPdfRenderer( +if (!\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer( $rendererName, $rendererLibraryPath )) { @@ -653,11 +653,11 @@ if (!PHPExcel_Settings::setPdfRenderer( Once you have identified the Renderer that you wish to use for PDF generation, you can write a .pdf file using the following code: ```php -$objWriter = new PHPExcel_Writer_PDF($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); $objWriter->save("05featuredemo.pdf"); ``` -Please note that PHPExcel_Writer_PDF only outputs the first worksheet by default. +Please note that \PhpOffice\PhpSpreadsheet\Writer\PDF only outputs the first worksheet by default. ##### Write all worksheets @@ -680,7 +680,7 @@ $objWriter->setSheetIndex(0); By default, this writer pre-calculates all formulas in the spreadsheet. This can be slow on large spreadsheets, and maybe even unwanted. You can however disable formula pre-calculation: ```php -$objWriter = new PHPExcel_Writer_PDF($objPHPExcel); +$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\PDF($spreadsheet); $objWriter->setPreCalculateFormulas(false); $objWriter->save("05featuredemo.pdf"); @@ -688,7 +688,7 @@ $objWriter->save("05featuredemo.pdf"); ##### Decimal and thousands separators -See section PHPExcel_Writer_CSV how to control the appearance of these. +See section \PhpOffice\PhpSpreadsheet\Writer\CSV how to control the appearance of these. ### Generating Excel files from templates (read, modify, write) @@ -697,14 +697,14 @@ Readers and writers are the tools that allow you to generate Excel files from te Here is an example how to open a template file, fill in a couple of fields and save it again: ```php -$objPHPexcel = PHPExcel_IOFactory::load('template.xlsx'); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('template.xlsx'); -$objWorksheet = $objPHPexcel->getActiveSheet(); +$objWorksheet = $spreadsheet->getActiveSheet(); $objWorksheet->getCell('A1')->setValue('John'); $objWorksheet->getCell('A2')->setValue('Smith'); -$objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel, 'Xls'); +$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls'); $objWriter->save('write.xls'); ``` diff --git a/docs/Overview/11-Appendices.md b/docs/Overview/11-Appendices.md index 6c02653e..a777ed48 100644 --- a/docs/Overview/11-Appendices.md +++ b/docs/Overview/11-Appendices.md @@ -1,4 +1,4 @@ -# PHPExcel Developer Documentation +# PhpSpreadsheet Developer Documentation ## Credits @@ -6,9 +6,9 @@ Please refer to the internet page [http://www.codeplex.com/PHPExcel/Wiki/View.as ## Valid array keys for style applyFromArray() -The following table lists the valid array keys for PHPExcel_Style applyFromArray() classes. If the "Maps to property" column maps a key to a setter, the value provided for that key will be applied directly. If the "Maps to property" column maps a key to a getter, the value provided for that key will be applied as another style array. +The following table lists the valid array keys for \PhpOffice\PhpSpreadsheet\Style applyFromArray() classes. If the "Maps to property" column maps a key to a setter, the value provided for that key will be applied directly. If the "Maps to property" column maps a key to a getter, the value provided for that key will be applied as another style array. -__PHPExcel_Style__ +__\PhpOffice\PhpSpreadsheet\Style__ Array key | Maps to property -------------|------------------- @@ -20,7 +20,7 @@ __PHPExcel_Style__ protection | getProtection() -__PHPExcel_Style_Fill__ +__\PhpOffice\PhpSpreadsheet\Style\Fill__ Array key | Maps to property -----------|------------------- @@ -31,7 +31,7 @@ __PHPExcel_Style_Fill__ color | getStartColor() -__PHPExcel_Style_Font__ +__\PhpOffice\PhpSpreadsheet\Style\Font__ Array key | Maps to property ------------|------------------- @@ -46,7 +46,7 @@ __PHPExcel_Style_Font__ subScript | setSubScript() -__PHPExcel_Style_Borders__ +__\PhpOffice\PhpSpreadsheet\Style\Borders__ Array key | Maps to property ------------------|------------------- @@ -62,7 +62,7 @@ __PHPExcel_Style_Borders__ outline | setOutline() -__PHPExcel_Style_Border__ +__\PhpOffice\PhpSpreadsheet\Style\Border__ Array key | Maps to property ----------|------------------- @@ -70,7 +70,7 @@ __PHPExcel_Style_Border__ color | getColor() -__PHPExcel_Style_Alignment__ +__\PhpOffice\PhpSpreadsheet\Style\Alignment__ Array key | Maps to property ------------|------------------- @@ -82,14 +82,14 @@ __PHPExcel_Style_Alignment__ indent | setIndent() -__PHPExcel_Style_NumberFormat__ +__\PhpOffice\PhpSpreadsheet\Style\NumberFormat__ Array key | Maps to property ----------|------------------- code | setFormatCode() -__PHPExcel_Style_Protection__ +__\PhpOffice\PhpSpreadsheet\Style\Protection__ Array key | Maps to property ----------|------------------- diff --git a/docs/ReadingSpreadsheetFiles/01-File-Formats.md b/docs/ReadingSpreadsheetFiles/01-File-Formats.md index b81505a2..38c021b9 100644 --- a/docs/ReadingSpreadsheetFiles/01-File-Formats.md +++ b/docs/ReadingSpreadsheetFiles/01-File-Formats.md @@ -1,11 +1,11 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Spreadsheet File Formats -PHPExcel can read a number of different spreadsheet and file formats, although not all features are supported by all of the readers. Check the Functionality Cross-Reference document (Functionality Cross-Reference.xls) for a list that identifies which features are supported by which readers. +PhpSpreadsheet can read a number of different spreadsheet and file formats, although not all features are supported by all of the readers. Check the Functionality Cross-Reference document (Functionality Cross-Reference.xls) for a list that identifies which features are supported by which readers. -Currently, PHPExcel supports the following File Types for Reading: +Currently, PhpSpreadsheet supports the following File Types for Reading: ### Xls diff --git a/docs/ReadingSpreadsheetFiles/02-Security.md b/docs/ReadingSpreadsheetFiles/02-Security.md index 12da958f..5c31947b 100644 --- a/docs/ReadingSpreadsheetFiles/02-Security.md +++ b/docs/ReadingSpreadsheetFiles/02-Security.md @@ -1,4 +1,4 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Security @@ -8,6 +8,6 @@ XML-based formats such as OfficeOpen XML, Excel2003 XML, OASIS and Gnumeric are - Disclosure whether a file is existent - Server Side Request Forgery - Command Execution (depending on the installed PHP wrappers) - -To prevent this, PHPExcel sets `libxml_disable_entity_loader` to `true` for the XML-based Readers by default. \ No newline at end of file + +To prevent this, PhpSpreadsheet sets `libxml_disable_entity_loader` to `true` for the XML-based Readers by default. \ No newline at end of file diff --git a/docs/ReadingSpreadsheetFiles/03-Loading-a-Spreadsheet.md b/docs/ReadingSpreadsheetFiles/03-Loading-a-Spreadsheet.md index e5e6ffe9..c3f70110 100644 --- a/docs/ReadingSpreadsheetFiles/03-Loading-a-Spreadsheet.md +++ b/docs/ReadingSpreadsheetFiles/03-Loading-a-Spreadsheet.md @@ -1,21 +1,21 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Loading a Spreadsheet File -The simplest way to load a workbook file is to let PHPExcel's IO Factory identify the file type and load it, calling the static load() method of the PHPExcel_IOFactory class. +The simplest way to load a workbook file is to let PhpSpreadsheet's IO Factory identify the file type and load it, calling the static load() method of the \PhpOffice\PhpSpreadsheet\IOFactory class. ```php $inputFileName = './sampleData/example1.xls'; -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = PHPExcel_IOFactory::load($inputFileName); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); ``` > See Examples/Reader/exampleReader01.php for a working example of this code. -The load() method will attempt to identify the file type, and instantiate a loader for that file type; using it to load the file and store the data and any formatting in a PHPExcel object. +The load() method will attempt to identify the file type, and instantiate a loader for that file type; using it to load the file and store the data and any formatting in a `Spreadsheet` object. The method makes an initial guess at the loader to instantiate based on the file extension; but will test the file before actually executing the load: so if (for example) the file is actually a CSV file or contains HTML markup, but that has been given a .xls extension (quite a common practise), it will reject the Xls loader that it would normally use for a .xls file; and test the file using the other loaders until it finds the appropriate loader, and then use that to read the file. -While easy to implement in your code, and you don't need to worry about the file type; this isn't the most efficient method to load a file; and it lacks the flexibility to configure the loader in any way before actually reading the file into a PHPExcel object. +While easy to implement in your code, and you don't need to worry about the file type; this isn't the most efficient method to load a file; and it lacks the flexibility to configure the loader in any way before actually reading the file into a `Spreadsheet` object. diff --git a/docs/ReadingSpreadsheetFiles/04-Loading-with-a-Reader.md b/docs/ReadingSpreadsheetFiles/04-Loading-with-a-Reader.md index 83be909c..06a5f6eb 100644 --- a/docs/ReadingSpreadsheetFiles/04-Loading-with-a-Reader.md +++ b/docs/ReadingSpreadsheetFiles/04-Loading-with-a-Reader.md @@ -1,23 +1,23 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Creating a Reader and Loading a Spreadsheet File -If you know the file type of the spreadsheet file that you need to load, you can instantiate a new reader object for that file type, then use the reader's load() method to read the file to a PHPExcel object. It is possible to instantiate the reader objects for each of the different supported filetype by name. However, you may get unpredictable results if the file isn't of the right type (e.g. it is a CSV with an extension of .xls), although this type of exception should normally be trapped. +If you know the file type of the spreadsheet file that you need to load, you can instantiate a new reader object for that file type, then use the reader's load() method to read the file to a `Spreadsheet` object. It is possible to instantiate the reader objects for each of the different supported filetype by name. However, you may get unpredictable results if the file isn't of the right type (e.g. it is a CSV with an extension of .xls), although this type of exception should normally be trapped. ```php $inputFileName = './sampleData/example1.xls'; /** Create a new Xls Reader **/ -$objReader = new PHPExcel_Reader_Excel5(); -// $objReader = new PHPExcel_Reader_Excel2007(); -// $objReader = new PHPExcel_Reader_Excel2003XML(); -// $objReader = new PHPExcel_Reader_OOCalc(); -// $objReader = new PHPExcel_Reader_SYLK(); -// $objReader = new PHPExcel_Reader_Gnumeric(); -// $objReader = new PHPExcel_Reader_CSV(); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Ods(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\SYLK(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Gnumeric(); +// $objReader = new \PhpOffice\PhpSpreadsheet\Reader\CSV(); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader02.php for a working example of this code. @@ -34,9 +34,9 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader03.php for a working example of this code. @@ -46,11 +46,11 @@ If you're uncertain of the filetype, you can use the IO Factory's identify() met $inputFileName = './sampleData/example1.xls'; /** Identify the type of $inputFileName **/ -$inputFileType = PHPExcel_IOFactory::identify($inputFileName); +$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName); /** Create a new Reader of the type that has been identified **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader04.php for a working example of this code. diff --git a/docs/ReadingSpreadsheetFiles/05-Reader-Options.md b/docs/ReadingSpreadsheetFiles/05-Reader-Options.md index 753f384b..a1576883 100644 --- a/docs/ReadingSpreadsheetFiles/05-Reader-Options.md +++ b/docs/ReadingSpreadsheetFiles/05-Reader-Options.md @@ -1,4 +1,4 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Spreadsheet Reader Options @@ -13,15 +13,15 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Advise the Reader that we only want to load cell data **/ $objReader->setReadDataOnly(true); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader05.php for a working example of this code. -It is important to note that Workbooks (and PHPExcel) store dates and times as simple numeric values: they can only be distinguished from other numeric values by the format mask that is applied to that cell. When setting read data only to true, PHPExcel doesn't read the cell format masks, so it is not possible to differentiate between dates/times and numbers. +It is important to note that Workbooks (and PhpSpreadsheet) store dates and times as simple numeric values: they can only be distinguished from other numeric values by the format mask that is applied to that cell. When setting read data only to true, PhpSpreadsheet doesn't read the cell format masks, so it is not possible to differentiate between dates/times and numbers. The Gnumeric loader has been written to read the format masks for date values even when read data only has been set to true, so it can differentiate between dates/times and numbers; but this change hasn't yet been implemented for the other readers. @@ -45,11 +45,11 @@ $inputFileName = './sampleData/example1.xls'; $sheetname = 'Data Sheet #2'; /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Advise the Reader of which WorkSheets we want to load **/ $objReader->setLoadSheetsOnly($sheetname); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader07.php for a working example of this code. @@ -61,11 +61,11 @@ $inputFileName = './sampleData/example1.xls'; $sheetnames = array('Data Sheet #1','Data Sheet #3'); /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Advise the Reader of which WorkSheets we want to load **/ $objReader->setLoadSheetsOnly($sheetnames); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader08.php for a working example of this code. @@ -76,11 +76,11 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example1.xls'; /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Advise the Reader to load all Worksheets **/ $objReader->setLoadAllSheets(); -/** Load $inputFileName to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load $inputFileName to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader06.php for a working example of this code. @@ -94,7 +94,7 @@ CSV | NO | HTML | NO ### Reading Only Specific Columns and Rows from a File (Read Filters) -If you are only interested in reading part of a worksheet, then you can write a filter class that identifies whether or not individual cells should be read by the loader. A read filter must implement the PHPExcel_Reader_IReadFilter interface, and contain a readCell() method that accepts arguments of $column, $row and $worksheetName, and return a boolean true or false that indicates whether a workbook cell identified by those arguments should be read or not. +If you are only interested in reading part of a worksheet, then you can write a filter class that identifies whether or not individual cells should be read by the loader. A read filter must implement the \PhpOffice\PhpSpreadsheet\Reader\IReadFilter interface, and contain a readCell() method that accepts arguments of $column, $row and $worksheetName, and return a boolean true or false that indicates whether a workbook cell identified by those arguments should be read or not. ```php $inputFileType = 'Xls'; @@ -102,8 +102,8 @@ $inputFileName = './sampleData/example1.xls'; $sheetname = 'Data Sheet #3'; -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class MyReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { // Read rows 1 to 7 and columns A to E only @@ -120,19 +120,19 @@ class MyReadFilter implements PHPExcel_Reader_IReadFilter $filterSubset = new MyReadFilter(); /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Tell the Reader that we want to use the Read Filter **/ $objReader->setReadFilter($filterSubset); -/** Load only the rows and columns that match our filter to PHPExcel **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load only the rows and columns that match our filter to Spreadsheet **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader09.php for a working example of this code. This example is not particularly useful, because it can only be used in a very specific circumstance (when you only want cells in the range A1:E7 from your worksheet. A generic Read Filter would probably be more useful: ```php -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class MyReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; private $_endRow = 0; @@ -168,8 +168,8 @@ $inputFileType = 'Xls'; $inputFileName = './sampleData/example2.xls'; -/** Define a Read Filter class implementing PHPExcel_Reader_IReadFilter */ -class chunkReadFilter implements PHPExcel_Reader_IReadFilter +/** Define a Read Filter class implementing \PhpOffice\PhpSpreadsheet\Reader\IReadFilter */ +class chunkReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { private $_startRow = 0; private $_endRow = 0; @@ -191,7 +191,7 @@ class chunkReadFilter implements PHPExcel_Reader_IReadFilter /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Define how many rows we want to read for each "chunk" **/ @@ -207,7 +207,7 @@ for ($startRow = 2; $startRow <= 65536; $startRow += $chunkSize) { /** Tell the Read Filter which rows we want this iteration **/ $chunkFilter->setRows($startRow,$chunkSize); /** Load only the rows that match our filter **/ - $objPHPExcel = $objReader->load($inputFileName); + $spreadsheet = $objReader->load($inputFileName); // Do some processing here } ``` @@ -221,9 +221,9 @@ Xlsx | YES | Xls | YES | Excel2003XML | YES | Ods | YES | SYLK | NO | Gnumeric | YES | CSV | YES | HTML | NO -### Combining Multiple Files into a Single PHPExcel Object +### Combining Multiple Files into a Single Spreadsheet Object -While you can limit the number of worksheets that are read from a workbook file using the setLoadSheetsOnly() method, certain readers also allow you to combine several individual "sheets" from different files into a single PHPExcel object, where each individual file is a single worksheet within that workbook. For each file that you read, you need to indicate which worksheet index it should be loaded into using the setSheetIndex() method of the $objReader, then use the loadIntoExisting() method rather than the load() method to actually read the file into that worksheet. +While you can limit the number of worksheets that are read from a workbook file using the setLoadSheetsOnly() method, certain readers also allow you to combine several individual "sheets" from different files into a single `Spreadsheet` object, where each individual file is a single worksheet within that workbook. For each file that you read, you need to indicate which worksheet index it should be loaded into using the setSheetIndex() method of the $objReader, then use the loadIntoExisting() method rather than the load() method to actually read the file into that worksheet. ```php $inputFileType = 'CSV'; @@ -233,15 +233,15 @@ $inputFileNames = array('./sampleData/example1.csv', ); /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Extract the first named file from the array list **/ $inputFileName = array_shift($inputFileNames); -/** Load the initial file to the first worksheet in a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load the initial file to the first worksheet in a `Spreadsheet` Object **/ +$spreadsheet = $objReader->load($inputFileName); /** Set the worksheet title (to the filename that we've loaded) **/ -$objPHPExcel->getActiveSheet() +$spreadsheet->getActiveSheet() ->setTitle(pathinfo($inputFileName,PATHINFO_BASENAME)); @@ -249,10 +249,10 @@ $objPHPExcel->getActiveSheet() foreach($inputFileNames as $sheet => $inputFileName) { /** Increment the worksheet index pointer for the Reader **/ $objReader->setSheetIndex($sheet+1); - /** Load the current file into a new worksheet in PHPExcel **/ - $objReader->loadIntoExisting($inputFileName,$objPHPExcel); + /** Load the current file into a new worksheet in Spreadsheet **/ + $objReader->loadIntoExisting($inputFileName,$spreadsheet); /** Set the worksheet title (to the filename that we've loaded) **/ - $objPHPExcel->getActiveSheet() + $spreadsheet->getActiveSheet() ->setTitle(pathinfo($inputFileName,PATHINFO_BASENAME)); } ``` @@ -260,7 +260,7 @@ foreach($inputFileNames as $sheet => $inputFileName) { Note that using the same sheet index for multiple sheets won't append files into the same sheet, but overwrite the results of the previous load. You cannot load multiple CSV files into the same worksheet. -Combining Multiple Files into a Single PHPExcel Object applies to: +Combining Multiple Files into a Single Spreadsheet Object applies to: Reader | Y/N |Reader | Y/N |Reader | Y/N | ----------|:---:|--------|:---:|--------------|:---:| @@ -279,7 +279,7 @@ $inputFileName = './sampleData/example2.csv'; echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'
'; /** Create a new Reader of the type defined in $inputFileType **/ -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Define how many rows we want to read for each "chunk" **/ @@ -293,8 +293,8 @@ $chunkFilter = new chunkReadFilter(); $objReader->setReadFilter($chunkFilter) ->setContiguous(true); -/** Instantiate a new PHPExcel object manually **/ -$objPHPExcel = new PHPExcel(); +/** Instantiate a new Spreadsheet object manually **/ +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); /** Set a sheet index **/ $sheet = 0; @@ -307,10 +307,10 @@ for ($startRow = 2; $startRow <= 1000000; $startRow += $chunkSize) { /** Increment the worksheet index pointer for the Reader **/ $objReader->setSheetIndex($sheet); /** Load only the rows that match our filter into a new worksheet **/ - $objReader->loadIntoExisting($inputFileName,$objPHPExcel); + $objReader->loadIntoExisting($inputFileName,$spreadsheet); /** Set the worksheet title for the sheet that we've justloaded) **/ /** and increment the sheet index as well **/ - $objPHPExcel->getActiveSheet()->setTitle('Country Data #'.(++$sheet)); + $spreadsheet->getActiveSheet()->setTitle('Country Data #'.(++$sheet)); } ``` > See Examples/Reader/exampleReader14.php for a working example of this code. @@ -319,7 +319,7 @@ This code will read 65,530 rows at a time from the CSV file that we’re loading The setContiguous() method for the Reader is important here. It is applicable only when working with a Read Filter, and identifies whether or not the cells should be stored by their position within the CSV file, or their position relative to the filter. -For example, if the filter returned true for cells in the range B2:C3, then with setContiguous set to false (the default) these would be loaded as B2:C3 in the PHPExcel object; but with setContiguous set to true, they would be loaded as A1:B2. +For example, if the filter returned true for cells in the range B2:C3, then with setContiguous set to false (the default) these would be loaded as B2:C3 in the `Spreadsheet` object; but with setContiguous set to true, they would be loaded as A1:B2. Splitting a single loaded file across multiple worksheets applies to: @@ -337,13 +337,13 @@ The CSV loader defaults to loading a file where comma is used as the separator, $inputFileType = 'CSV'; $inputFileName = './sampleData/example1.tsv'; -/** Create a new Reader of the type defined in $inputFileType **/ $objReader = PHPExcel_IOFactory::createReader($inputFileType); +/** Create a new Reader of the type defined in $inputFileType **/ $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); /** Set the delimiter to a TAB character **/ $objReader->setDelimiter("\t"); // $objReader->setDelimiter('|'); -/** Load the file to a PHPExcel Object **/ -$objPHPExcel = $objReader->load($inputFileName); +/** Load the file to a Spreadsheet Object **/ +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader15.php for a working example of this code. @@ -363,22 +363,22 @@ CSV | YES | HTML | NO ### A Brief Word about the Advanced Value Binder -When loading data from a file that contains no formatting information, such as a CSV file, then data is read either as strings or numbers (float or integer). This means that PHPExcel does not automatically recognise dates/times (such as "16-Apr-2009" or "13:30"), booleans ("TRUE" or "FALSE"), percentages ("75%"), hyperlinks ("http://www.phpexcel.net"), etc as anything other than simple strings. However, you can apply additional processing that is executed against these values during the load process within a Value Binder. +When loading data from a file that contains no formatting information, such as a CSV file, then data is read either as strings or numbers (float or integer). This means that PhpSpreadsheet does not automatically recognise dates/times (such as "16-Apr-2009" or "13:30"), booleans ("TRUE" or "FALSE"), percentages ("75%"), hyperlinks ("http://www.phpexcel.net"), etc as anything other than simple strings. However, you can apply additional processing that is executed against these values during the load process within a Value Binder. -A Value Binder is a class that implement the PHPExcel_Cell_IValueBinder interface. It must contain a bindValue() method that accepts a PHPExcel_Cell and a value as arguments, and return a boolean true or false that indicates whether the workbook cell has been populated with the value or not. The Advanced Value Binder implements such a class: amongst other tests, it identifies a string comprising "TRUE" or "FALSE" (based on locale settings) and sets it to a boolean; or a number in scientific format (e.g. "1.234e-5") and converts it to a float; or dates and times, converting them to their Excel timestamp value – before storing the value in the cell object. It also sets formatting for strings that are identified as dates, times or percentages. It could easily be extended to provide additional handling (including text or cell formatting) when it encountered a hyperlink, or HTML markup within a CSV file. +A Value Binder is a class that implement the \PhpOffice\PhpSpreadsheet\Cell\IValueBinder interface. It must contain a bindValue() method that accepts a \PhpOffice\PhpSpreadsheet\Cell and a value as arguments, and return a boolean true or false that indicates whether the workbook cell has been populated with the value or not. The Advanced Value Binder implements such a class: amongst other tests, it identifies a string comprising "TRUE" or "FALSE" (based on locale settings) and sets it to a boolean; or a number in scientific format (e.g. "1.234e-5") and converts it to a float; or dates and times, converting them to their Excel timestamp value – before storing the value in the cell object. It also sets formatting for strings that are identified as dates, times or percentages. It could easily be extended to provide additional handling (including text or cell formatting) when it encountered a hyperlink, or HTML markup within a CSV file. So using a Value Binder allows a great deal more flexibility in the loader logic when reading unformatted text files. ```php -/** Tell PHPExcel that we want to use the Advanced Value Binder **/ -PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() ); +/** Tell PhpSpreadsheet that we want to use the Advanced Value Binder **/ +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder( new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder() ); $inputFileType = 'CSV'; $inputFileName = './sampleData/example1.tsv'; -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $objReader->setDelimiter("\t"); -$objPHPExcel = $objReader->load($inputFileName); +$spreadsheet = $objReader->load($inputFileName); ``` > See Examples/Reader/exampleReader15.php for a working example of this code. diff --git a/docs/ReadingSpreadsheetFiles/06-Error-Handling.md b/docs/ReadingSpreadsheetFiles/06-Error-Handling.md index d3e064f9..fcb3b96b 100644 --- a/docs/ReadingSpreadsheetFiles/06-Error-Handling.md +++ b/docs/ReadingSpreadsheetFiles/06-Error-Handling.md @@ -1,18 +1,18 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Error Handling -Of course, you should always apply some error handling to your scripts as well. PHPExcel throws exceptions, so you can wrap all your code that accesses the library methods within Try/Catch blocks to trap for any problems that are encountered, and deal with them in an appropriate manner. +Of course, you should always apply some error handling to your scripts as well. PhpSpreadsheet throws exceptions, so you can wrap all your code that accesses the library methods within Try/Catch blocks to trap for any problems that are encountered, and deal with them in an appropriate manner. -The PHPExcel Readers throw a PHPExcel_Reader_Exception. +The PhpSpreadsheet Readers throw a \PhpOffice\PhpSpreadsheet\Reader\Exception. ```php $inputFileName = './sampleData/example-1.xls'; try { - /** Load $inputFileName to a PHPExcel Object **/ - $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); -} catch(PHPExcel_Reader_Exception $e) { + /** Load $inputFileName to a Spreadsheet Object **/ + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName); +} catch(\PhpOffice\PhpSpreadsheet\Reader\Exception $e) { die('Error loading file: '.$e->getMessage()); } ``` diff --git a/docs/ReadingSpreadsheetFiles/07-Helper-Methods.md b/docs/ReadingSpreadsheetFiles/07-Helper-Methods.md index 57dbec7a..d1f1edb0 100644 --- a/docs/ReadingSpreadsheetFiles/07-Helper-Methods.md +++ b/docs/ReadingSpreadsheetFiles/07-Helper-Methods.md @@ -1,4 +1,4 @@ -# PHPExcel User Documentation – Reading Spreadsheet Files +# PhpSpreadsheet User Documentation – Reading Spreadsheet Files ## Helper Methods @@ -10,7 +10,7 @@ You can retrieve a list of worksheet names contained in a file without loading t The `listWorksheetNames()` method returns a simple array listing each worksheet name within the workbook: ```php -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetNames = $objReader->listWorksheetNames($inputFileName); @@ -28,7 +28,7 @@ echo ''; The `listWorksheetInfo()` method returns a nested array, with each entry listing the name and dimensions for a worksheet: ```php -$objReader = PHPExcel_IOFactory::createReader($inputFileType); +$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $worksheetData = $objReader->listWorksheetInfo($inputFileName);
' . + echo '' . $objWorksheet->getCell($col . $row) - ->getValue() . + ->getValue() . '