Fix sample which does't work (#123)
This commit is contained in:
parent
2e24a1e1b4
commit
0f0de914f4
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Returns the average of selected database entries.</h2>
|
<h2>Returns the average of selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Counts the cells that contain numbers in a database.</h2>
|
<h2>Counts the cells that contain numbers in a database.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Extracts a single value from a column of a list or database that matches conditions that you specify.</h2>
|
<h2>Extracts a single value from a column of a list or database that matches conditions that you specify.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Returns the maximum value from selected database entries.</h2>
|
<h2>Returns the maximum value from selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
|
||||||
include 'PHPExcel.php';
|
|
||||||
|
|
||||||
// Create new PhpSpreadsheet object
|
// Create new PhpSpreadsheet object
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Returns the minimum value from selected database entries.</h2>
|
<h2>Returns the minimum value from selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
|
||||||
include 'PHPExcel.php';
|
|
||||||
|
|
||||||
// Create new PhpSpreadsheet object
|
// Create new PhpSpreadsheet object
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Multiplies the values in a column of a list or database that match conditions that you specify.</h2>
|
<h2>Multiplies the values in a column of a list or database that match conditions that you specify.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
|
||||||
include 'PHPExcel.php';
|
|
||||||
|
|
||||||
// Create new PhpSpreadsheet object
|
// Create new PhpSpreadsheet object
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Estimates the standard deviation based on a sample of selected database entries.</h2>
|
<h2>Estimates the standard deviation based on a sample of selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
|
||||||
include 'PHPExcel.php';
|
|
||||||
|
|
||||||
// Create new PhpSpreadsheet object
|
// Create new PhpSpreadsheet object
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Calculates the standard deviation based on the entire population of selected database entries.</h2>
|
<h2>Calculates the standard deviation based on the entire population of selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
|
||||||
include 'PHPExcel.php';
|
|
||||||
|
|
||||||
// Create new PhpSpreadsheet object
|
// Create new PhpSpreadsheet object
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Estimates variance based on a sample from selected database entries.</h2>
|
<h2>Estimates variance based on a sample from selected database entries.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PhpSpreadsheet */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PhpSpreadsheet();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Examples</title>
|
<title>PhpSpreadsheet Calculation Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Calculates variance based on the entire population of selected database entries,</h2>
|
<h2>Calculates variance based on the entire population of selected database entries,</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PHPExcel */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Examples</title>
|
<title>PhpSpreadsheet Calculation Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Returns the serial number of a particular date.</h2>
|
<h2>Returns the serial number of a particular date.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PHPExcel */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
@ -76,4 +72,6 @@ echo '<hr />';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Examples</title>
|
<title>PhpSpreadsheet Calculation Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Converts a date in the form of text to a serial number.</h2>
|
<h2>Converts a date in the form of text to a serial number.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PHPExcel */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
@ -51,7 +47,7 @@ echo '<hr />';
|
||||||
|
|
||||||
// Test the formulae
|
// Test the formulae
|
||||||
?>
|
?>
|
||||||
<p><strong>Warning: </strong>The PHPExcel DATEVALUE() function accepts a wider range of date formats than MS Excel's DATEFORMAT() function.</p>
|
<p><strong>Warning: </strong>The PhpSpreadsheet DATEVALUE() function accepts a wider range of date formats than MS Excel's DATEFORMAT() function.</p>
|
||||||
<table border="1" cellspacing="0">
|
<table border="1" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Date String</th>
|
<th>Date String</th>
|
||||||
|
@ -69,4 +65,6 @@ echo '<hr />';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Examples</title>
|
<title>PhpSpreadsheet Calculation Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Returns the serial number of a particular time.</h2>
|
<h2>Returns the serial number of a particular time.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PHPExcel */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
@ -74,4 +70,6 @@ echo '<hr />';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Examples</title>
|
<title>PhpSpreadsheet Calculation Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -19,14 +19,10 @@ date_default_timezone_set('Europe/London');
|
||||||
<h2>Converts a time in the form of text to a serial number.</h2>
|
<h2>Converts a time in the form of text to a serial number.</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../../Classes/');
|
|
||||||
|
|
||||||
/** Include PHPExcel */
|
// Create new PhpSpreadsheet object
|
||||||
include 'PHPExcel.php';
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
// Create new PHPExcel object
|
|
||||||
$spreadsheet = new PHPExcel();
|
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
|
|
||||||
// Add some data
|
// Add some data
|
||||||
|
@ -65,4 +61,6 @@ echo '<hr />';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -10,14 +10,14 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Calculation Function Examples</title>
|
<title>PhpSpreadsheet Calculation Function Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo '<h1>PHPExcel Calculation Function Examples</h1>';
|
echo '<h1>PhpSpreadsheet Calculation Function Examples</h1>';
|
||||||
|
|
||||||
$exampleTypeList = glob('./*', GLOB_ONLYDIR);
|
$exampleTypeList = glob('./*', GLOB_ONLYDIR);
|
||||||
|
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #01</title>
|
<title>PhpSpreadsheet Reader Example #01</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #01</h1>
|
<h1>PhpSpreadsheet Reader Example #01</h1>
|
||||||
<h2>Simple File Reader using \PhpOffice\PhpSpreadsheet\IOFactory::load()</h2>
|
<h2>Simple File Reader using \PhpOffice\PhpSpreadsheet\IOFactory::load()</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
||||||
|
|
|
@ -5,23 +5,19 @@ set_time_limit(0);
|
||||||
|
|
||||||
date_default_timezone_set('Europe/London');
|
date_default_timezone_set('Europe/London');
|
||||||
|
|
||||||
/* Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #02</title>
|
<title>PhpSpreadsheet Reader Example #02</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #02</h1>
|
<h1>PhpSpreadsheet Reader Example #02</h1>
|
||||||
<h2>Simple File Reader using a Specified Reader</h2>
|
<h2>Simple File Reader using a Specified Reader</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #03</title>
|
<title>PhpSpreadsheet Reader Example #03</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #03</h1>
|
<h1>PhpSpreadsheet Reader Example #03</h1>
|
||||||
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Return a Reader</h2>
|
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Return a Reader</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #04</title>
|
<title>PhpSpreadsheet Reader Example #04</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #04</h1>
|
<h1>PhpSpreadsheet Reader Example #04</h1>
|
||||||
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Identify a Reader to Use</h2>
|
<h2>Simple File Reader using the \PhpOffice\PhpSpreadsheet\IOFactory to Identify a Reader to Use</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #05</title>
|
<title>PhpSpreadsheet Reader Example #05</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #05</h1>
|
<h1>PhpSpreadsheet Reader Example #05</h1>
|
||||||
<h2>Simple File Reader using the "Read Data Only" Option</h2>
|
<h2>Simple File Reader using the "Read Data Only" Option</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #06</title>
|
<title>PhpSpreadsheet Reader Example #06</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #06</h1>
|
<h1>PhpSpreadsheet Reader Example #06</h1>
|
||||||
<h2>Simple File Reader Loading All WorkSheets</h2>
|
<h2>Simple File Reader Loading All WorkSheets</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #07</title>
|
<title>PhpSpreadsheet Reader Example #07</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #07</h1>
|
<h1>PhpSpreadsheet Reader Example #07</h1>
|
||||||
<h2>Simple File Reader Loading a Single Named WorkSheet</h2>
|
<h2>Simple File Reader Loading a Single Named WorkSheet</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #08</title>
|
<title>PhpSpreadsheet Reader Example #08</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #08</h1>
|
<h1>PhpSpreadsheet Reader Example #08</h1>
|
||||||
<h2>Simple File Reader Loading Several Named WorkSheets</h2>
|
<h2>Simple File Reader Loading Several Named WorkSheets</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #09</title>
|
<title>PhpSpreadsheet Reader Example #09</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #09</h1>
|
<h1>PhpSpreadsheet Reader Example #09</h1>
|
||||||
<h2>Simple File Reader Using a Read Filter</h2>
|
<h2>Simple File Reader Using a Read Filter</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #10</title>
|
<title>PhpSpreadsheet Reader Example #10</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #10</h1>
|
<h1>PhpSpreadsheet Reader Example #10</h1>
|
||||||
<h2>Simple File Reader Using a Configurable Read Filter</h2>
|
<h2>Simple File Reader Using a Configurable Read Filter</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #11</title>
|
<title>PhpSpreadsheet Reader Example #11</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #11</h1>
|
<h1>PhpSpreadsheet Reader Example #11</h1>
|
||||||
<h2>Reading a Workbook in "Chunks" Using a Configurable Read Filter (Version 1)</h2>
|
<h2>Reading a Workbook in "Chunks" Using a Configurable Read Filter (Version 1)</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
@ -78,7 +74,7 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
$chunkFilter = new chunkReadFilter($startRow, $chunkSize);
|
$chunkFilter = new chunkReadFilter($startRow, $chunkSize);
|
||||||
/* Tell the Reader that we want to use the new Read Filter that we've just Instantiated **/
|
/* Tell the Reader that we want to use the new Read Filter that we've just Instantiated **/
|
||||||
$reader->setReadFilter($chunkFilter);
|
$reader->setReadFilter($chunkFilter);
|
||||||
/* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/
|
/* Load only the rows that match our filter from $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
// Do some processing here
|
// Do some processing here
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #12</title>
|
<title>PhpSpreadsheet Reader Example #12</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #12</h1>
|
<h1>PhpSpreadsheet Reader Example #12</h1>
|
||||||
<h2>Reading a Workbook in "Chunks" Using a Configurable Read Filter (Version 2)</h2>
|
<h2>Reading a Workbook in "Chunks" Using a Configurable Read Filter (Version 2)</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Set Include path to point at the PHPExcel Classes folder **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** Include \PhpOffice\PhpSpreadsheet\IOFactory **/
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
@ -81,7 +77,7 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />';
|
echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />';
|
||||||
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
/* Tell the Read Filter, the limits on which rows we want to read this iteration **/
|
||||||
$chunkFilter->setRows($startRow, $chunkSize);
|
$chunkFilter->setRows($startRow, $chunkSize);
|
||||||
/* Load only the rows that match our filter from $inputFileName to a PHPExcel Object **/
|
/* Load only the rows that match our filter from $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
// Do some processing here
|
// Do some processing here
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #13</title>
|
<title>PhpSpreadsheet Reader Example #13</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #13</h1>
|
<h1>PhpSpreadsheet Reader Example #13</h1>
|
||||||
<h2>Simple File Reader for Multiple CSV Files</h2>
|
<h2>Simple File Reader for Multiple CSV Files</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Csv';
|
$inputFileType = 'Csv';
|
||||||
$inputFileNames = ['./sampleData/example1.csv', './sampleData/example2.csv'];
|
$inputFileNames = ['./sampleData/example1.csv', './sampleData/example2.csv'];
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
set_time_limit(0);
|
||||||
|
|
||||||
|
date_default_timezone_set('Europe/London');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #15</title>
|
<title>PhpSpreadsheet Reader Example #14</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #14</h1>
|
<h1>PhpSpreadsheet Reader Example #14</h1>
|
||||||
<h2>Reading a Large CSV file in "Chunks" to split across multiple Worksheets</h2>
|
<h2>Reading a Large CSV file in "Chunks" to split across multiple Worksheets</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Csv';
|
$inputFileType = 'Csv';
|
||||||
$inputFileName = './sampleData/example2.csv';
|
$inputFileName = './sampleData/example2.csv';
|
||||||
|
@ -69,8 +70,8 @@ $chunkFilter = new chunkReadFilter();
|
||||||
$reader->setReadFilter($chunkFilter)
|
$reader->setReadFilter($chunkFilter)
|
||||||
->setContiguous(true);
|
->setContiguous(true);
|
||||||
|
|
||||||
/* Instantiate a new PHPExcel object manually **/
|
/* Instantiate a new PhpSpreadsheet object manually **/
|
||||||
$spreadsheet = new PHPExcel();
|
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
|
||||||
|
|
||||||
/* Set a sheet index **/
|
/* Set a sheet index **/
|
||||||
$sheet = 0;
|
$sheet = 0;
|
||||||
|
@ -83,7 +84,7 @@ for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) {
|
||||||
|
|
||||||
/* Increment the worksheet index pointer for the Reader **/
|
/* Increment the worksheet index pointer for the Reader **/
|
||||||
$reader->setSheetIndex($sheet);
|
$reader->setSheetIndex($sheet);
|
||||||
/* Load only the rows that match our filter into a new worksheet in the PHPExcel Object **/
|
/* Load only the rows that match our filter into a new worksheet in the PhpSpreadsheet Object **/
|
||||||
$reader->loadIntoExisting($inputFileName, $spreadsheet);
|
$reader->loadIntoExisting($inputFileName, $spreadsheet);
|
||||||
/* Set the worksheet title (to reference the "sheet" of data that we've loaded) **/
|
/* Set the worksheet title (to reference the "sheet" of data that we've loaded) **/
|
||||||
/* and increment the sheet index as well **/
|
/* and increment the sheet index as well **/
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
set_time_limit(0);
|
||||||
|
|
||||||
|
date_default_timezone_set('Europe/London');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #15</title>
|
<title>PhpSpreadsheet Reader Example #15</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #15</h1>
|
<h1>PhpSpreadsheet Reader Example #15</h1>
|
||||||
<h2>Simple File Reader for Tab-Separated Value File using the Advanced Value Binder</h2>
|
<h2>Simple File Reader for Tab-Separated Value File using the Advanced Value Binder</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder());
|
\PhpOffice\PhpSpreadsheet\Cell::setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder());
|
||||||
|
|
||||||
|
|
|
@ -10,26 +10,22 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #16</title>
|
<title>PhpSpreadsheet Reader Example #16</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #16</h1>
|
<h1>PhpSpreadsheet Reader Example #16</h1>
|
||||||
<h2>Handling Loader Exceptions using Try/Catch</h2>
|
<h2>Handling Loader Exceptions using Try/Catch</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileName = './sampleData/example_1.xls';
|
$inputFileName = './sampleData/example_1.xls';
|
||||||
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
||||||
try {
|
try {
|
||||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
|
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
|
||||||
} catch (\PHPExcel\Reader\Exception $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage());
|
die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #17</title>
|
<title>PhpSpreadsheet Reader Example #17</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #17</h1>
|
<h1>PhpSpreadsheet Reader Example #17</h1>
|
||||||
<h2>Simple File Reader Loading Several Named WorkSheets</h2>
|
<h2>Simple File Reader Loading Several Named WorkSheets</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #18</title>
|
<title>PhpSpreadsheet Reader Example #18</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #18</h1>
|
<h1>PhpSpreadsheet Reader Example #18</h1>
|
||||||
<h2>Reading list of WorkSheets without loading entire file</h2>
|
<h2>Reading list of WorkSheets without loading entire file</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,20 +10,16 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reader Example #19</title>
|
<title>PhpSpreadsheet Reader Example #19</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reader Example #19</h1>
|
<h1>PhpSpreadsheet Reader Example #19</h1>
|
||||||
<h2>Reading WorkSheet information without loading entire file</h2>
|
<h2>Reading WorkSheet information without loading entire file</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
|
|
|
@ -10,27 +10,23 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reading WorkBook Data Example #01</title>
|
<title>PhpSpreadsheet Reading WorkBook Data Example #01</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reading WorkBook Data Example #01</h1>
|
<h1>PhpSpreadsheet Reading WorkBook Data Example #01</h1>
|
||||||
<h2>Read the WorkBook Properties</h2>
|
<h2>Read the WorkBook Properties</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
/* Create a new Reader of the type defined in $inputFileType **/
|
/* Create a new Reader of the type defined in $inputFileType **/
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
/* Load $inputFileName to a PHPExcel Object **/
|
/* Load $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
|
@ -10,27 +10,23 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reading WorkBook Data Example #02</title>
|
<title>PhpSpreadsheet Reading WorkBook Data Example #02</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reading WorkBook Data Example #02</h1>
|
<h1>PhpSpreadsheet Reading WorkBook Data Example #02</h1>
|
||||||
<h2>Read a list of Custom Properties for a WorkBook</h2>
|
<h2>Read a list of Custom Properties for a WorkBook</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xlsx';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileName = './sampleData/example1.xlsx';
|
$inputFileName = './sampleData/example1.xlsx';
|
||||||
|
|
||||||
/* Create a new Reader of the type defined in $inputFileType **/
|
/* Create a new Reader of the type defined in $inputFileType **/
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
/* Load $inputFileName to a PHPExcel Object **/
|
/* Load $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
|
@ -10,27 +10,23 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reading WorkBook Data Example #03</title>
|
<title>PhpSpreadsheet Reading WorkBook Data Example #03</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reading WorkBook Data Example #03</h1>
|
<h1>PhpSpreadsheet Reading WorkBook Data Example #03</h1>
|
||||||
<h2>Read Custom Property Values for a WorkBook</h2>
|
<h2>Read Custom Property Values for a WorkBook</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xlsx';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileName = './sampleData/example1.xlsx';
|
$inputFileName = './sampleData/example1.xlsx';
|
||||||
|
|
||||||
/* Create a new Reader of the type defined in $inputFileType **/
|
/* Create a new Reader of the type defined in $inputFileType **/
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
/* Load $inputFileName to a PHPExcel Object **/
|
/* Load $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
|
@ -10,38 +10,34 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Reading WorkBook Data Example #04</title>
|
<title>PhpSpreadsheet Reading WorkBook Data Example #04</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>PHPExcel Reading WorkBook Data Example #04</h1>
|
<h1>PhpSpreadsheet Reading WorkBook Data Example #04</h1>
|
||||||
<h2>Get a List of the Worksheets in a WorkBook</h2>
|
<h2>Get a List of the Worksheets in a WorkBook</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/** Include path **/
|
require_once __DIR__ . '/../../../src/Bootstrap.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
|
||||||
|
|
||||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
|
||||||
include 'PHPExcel/IOFactory.php';
|
|
||||||
|
|
||||||
$inputFileType = 'Xls';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example2.xls';
|
$inputFileName = './sampleData/example2.xls';
|
||||||
|
|
||||||
/* Create a new Reader of the type defined in $inputFileType **/
|
/* Create a new Reader of the type defined in $inputFileType **/
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
/* Load $inputFileName to a PHPExcel Object **/
|
/* Load $inputFileName to a PhpSpreadsheet Object **/
|
||||||
$spreadsheet = $reader->load($inputFileName);
|
$spreadsheet = $reader->load($inputFileName);
|
||||||
|
|
||||||
echo '<hr />';
|
echo '<hr />';
|
||||||
|
|
||||||
echo 'Reading the number of Worksheets in the WorkBook<br />';
|
echo 'Reading the number of Worksheets in the WorkBook<br />';
|
||||||
/* Use the PHPExcel object's getSheetCount() method to get a count of the number of WorkSheets in the WorkBook */
|
/* Use the PhpSpreadsheet object's getSheetCount() method to get a count of the number of WorkSheets in the WorkBook */
|
||||||
$sheetCount = $spreadsheet->getSheetCount();
|
$sheetCount = $spreadsheet->getSheetCount();
|
||||||
echo 'There ',(($sheetCount == 1) ? 'is' : 'are'),' ',$sheetCount,' WorkSheet',(($sheetCount == 1) ? '' : 's'),' in the WorkBook<br /><br />';
|
echo 'There ',(($sheetCount == 1) ? 'is' : 'are'),' ',$sheetCount,' WorkSheet',(($sheetCount == 1) ? '' : 's'),' in the WorkBook<br /><br />';
|
||||||
|
|
||||||
echo 'Reading the names of Worksheets in the WorkBook<br />';
|
echo 'Reading the names of Worksheets in the WorkBook<br />';
|
||||||
/* Use the PHPExcel object's getSheetNames() method to get an array listing the names/titles of the WorkSheets in the WorkBook */
|
/* Use the PhpSpreadsheet object's getSheetNames() method to get an array listing the names/titles of the WorkSheets in the WorkBook */
|
||||||
$sheetNames = $spreadsheet->getSheetNames();
|
$sheetNames = $spreadsheet->getSheetNames();
|
||||||
foreach ($sheetNames as $sheetIndex => $sheetName) {
|
foreach ($sheetNames as $sheetIndex => $sheetName) {
|
||||||
echo 'WorkSheet #',$sheetIndex,' is named "',$sheetName,'"<br />';
|
echo 'WorkSheet #',$sheetIndex,' is named "',$sheetName,'"<br />';
|
||||||
|
|
|
@ -10,7 +10,7 @@ date_default_timezone_set('Europe/London');
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<title>PHPExcel Examples</title>
|
<title>PhpSpreadsheet Examples</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -20,7 +20,7 @@ date_default_timezone_set('Europe/London');
|
||||||
$exampleTypeList = glob('./*', GLOB_ONLYDIR);
|
$exampleTypeList = glob('./*', GLOB_ONLYDIR);
|
||||||
|
|
||||||
foreach ($exampleTypeList as $exampleType) {
|
foreach ($exampleTypeList as $exampleType) {
|
||||||
echo '<h1>PHPExcel ' . pathinfo($exampleType, PATHINFO_BASENAME) . ' Examples</h1>';
|
echo '<h1>PhpSpreadsheet ' . pathinfo($exampleType, PATHINFO_BASENAME) . ' Examples</h1>';
|
||||||
|
|
||||||
$exampleList = glob('./' . $exampleType . '/*.php');
|
$exampleList = glob('./' . $exampleType . '/*.php');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue