Skip to content

Commit 5e49a87

Browse files
committed
Merge branch 'develop'
2 parents ce1e834 + c8089f9 commit 5e49a87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1989
-1997
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2323
- Fix to getCell() method when cell reference includes a worksheet reference - @MarkBaker
2424
- Ignore inlineStr type if formula element exists - @ncrypthic [#570](https://github.com/PHPOffice/PHPExcel/issues/570)
2525
- Excel 2007 Reader freezes because of conditional formatting - @rentalhost [#575](https://github.com/PHPOffice/PHPExcel/issues/575)
26+
- Readers will now parse files containing worksheet titles over 31 characters [#176](https://github.com/PHPOffice/PhpSpreadsheet/pull/176)
2627

2728
### General
2829

docs/Examples/Calculations/Database/DAVERAGE.php

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,73 @@
66
set_time_limit(0);
77

88
date_default_timezone_set('Europe/London');
9-
109
?>
1110
<html>
12-
<head>
13-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
14-
15-
<title>PhpSpreadsheet Calculation Examples</title>
11+
<head>
12+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1613

17-
</head>
18-
<body>
14+
<title>PhpSpreadsheet Calculation Examples</title>
1915

20-
<h1>DAVERAGE</h1>
21-
<h2>Returns the average of selected database entries.</h2>
22-
<?php
16+
</head>
17+
<body>
2318

24-
require_once __DIR__ . '/../../../../src/Bootstrap.php';
19+
<h1>DAVERAGE</h1>
20+
<h2>Returns the average of selected database entries.</h2>
21+
<?php
22+
require_once __DIR__ . '/../../../../src/Bootstrap.php';
2523

26-
// Create new PhpSpreadsheet object
27-
$spreadsheet = new Spreadsheet();
28-
$worksheet = $spreadsheet->getActiveSheet();
24+
// Create new PhpSpreadsheet object
25+
$spreadsheet = new Spreadsheet();
26+
$worksheet = $spreadsheet->getActiveSheet();
2927

30-
// Add some data
31-
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
32-
['Apple', 18, 20, 14, 105.00],
33-
['Pear', 12, 12, 10, 96.00],
34-
['Cherry', 13, 14, 9, 105.00],
35-
['Apple', 14, 15, 10, 75.00],
36-
['Pear', 9, 8, 8, 76.80],
37-
['Apple', 8, 9, 6, 45.00],
38-
];
39-
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
40-
['="=Apple"', '>10', null, null, null, '<16'],
41-
['="=Pear"', null, null, null, null, null],
42-
];
28+
// Add some data
29+
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
30+
['Apple', 18, 20, 14, 105.00],
31+
['Pear', 12, 12, 10, 96.00],
32+
['Cherry', 13, 14, 9, 105.00],
33+
['Apple', 14, 15, 10, 75.00],
34+
['Pear', 9, 8, 8, 76.80],
35+
['Apple', 8, 9, 6, 45.00],
36+
];
37+
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
38+
['="=Apple"', '>10', null, null, null, '<16'],
39+
['="=Pear"', null, null, null, null, null],
40+
];
4341

44-
$worksheet->fromArray($criteria, null, 'A1');
45-
$worksheet->fromArray($database, null, 'A4');
42+
$worksheet->fromArray($criteria, null, 'A1');
43+
$worksheet->fromArray($database, null, 'A4');
4644

47-
$worksheet->setCellValue('A12', 'The Average yield of Apple trees over 10\' in height');
48-
$worksheet->setCellValue('B12', '=DAVERAGE(A4:E10,"Yield",A1:B2)');
45+
$worksheet->setCellValue('A12', 'The Average yield of Apple trees over 10\' in height');
46+
$worksheet->setCellValue('B12', '=DAVERAGE(A4:E10,"Yield",A1:B2)');
4947

50-
$worksheet->setCellValue('A13', 'The Average age of all Apple and Pear trees in the orchard');
51-
$worksheet->setCellValue('B13', '=DAVERAGE(A4:E10,3,A1:A3)');
48+
$worksheet->setCellValue('A13', 'The Average age of all Apple and Pear trees in the orchard');
49+
$worksheet->setCellValue('B13', '=DAVERAGE(A4:E10,3,A1:A3)');
5250

53-
echo '<hr />';
51+
echo '<hr />';
5452

55-
echo '<h4>Database</h4>';
53+
echo '<h4>Database</h4>';
5654

57-
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
58-
var_dump($databaseData);
55+
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
56+
var_dump($databaseData);
5957

60-
echo '<hr />';
58+
echo '<hr />';
6159

62-
// Test the formulae
63-
echo '<h4>Criteria</h4>';
60+
// Test the formulae
61+
echo '<h4>Criteria</h4>';
6462

65-
$criteriaData = $worksheet->rangeToArray('A1:B2', null, true, true, true);
66-
var_dump($criteriaData);
63+
$criteriaData = $worksheet->rangeToArray('A1:B2', null, true, true, true);
64+
var_dump($criteriaData);
6765

68-
echo $worksheet->getCell('A12')->getValue() . '<br />';
69-
echo 'DAVERAGE() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
66+
echo $worksheet->getCell('A12')->getValue() . '<br />';
67+
echo 'DAVERAGE() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
7068

71-
echo '<h4>Criteria</h4>';
69+
echo '<h4>Criteria</h4>';
7270

73-
$criteriaData = $worksheet->rangeToArray('A1:A3', null, true, true, true);
74-
var_dump($criteriaData);
71+
$criteriaData = $worksheet->rangeToArray('A1:A3', null, true, true, true);
72+
var_dump($criteriaData);
7573

76-
echo $worksheet->getCell('A13')->getValue() . '<br />';
77-
echo 'DAVERAGE() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
78-
79-
?>
80-
<body>
74+
echo $worksheet->getCell('A13')->getValue() . '<br />';
75+
echo 'DAVERAGE() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
76+
?>
77+
<body>
8178
</html>

docs/Examples/Calculations/Database/DCOUNT.php

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,73 @@
66
set_time_limit(0);
77

88
date_default_timezone_set('Europe/London');
9-
109
?>
1110
<html>
12-
<head>
13-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
14-
15-
<title>PhpSpreadsheet Calculation Examples</title>
11+
<head>
12+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1613

17-
</head>
18-
<body>
14+
<title>PhpSpreadsheet Calculation Examples</title>
1915

20-
<h1>DCOUNT</h1>
21-
<h2>Counts the cells that contain numbers in a database.</h2>
22-
<?php
16+
</head>
17+
<body>
2318

24-
require_once __DIR__ . '/../../../../src/Bootstrap.php';
19+
<h1>DCOUNT</h1>
20+
<h2>Counts the cells that contain numbers in a database.</h2>
21+
<?php
22+
require_once __DIR__ . '/../../../../src/Bootstrap.php';
2523

26-
// Create new PhpSpreadsheet object
27-
$spreadsheet = new Spreadsheet();
28-
$worksheet = $spreadsheet->getActiveSheet();
24+
// Create new PhpSpreadsheet object
25+
$spreadsheet = new Spreadsheet();
26+
$worksheet = $spreadsheet->getActiveSheet();
2927

30-
// Add some data
31-
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
32-
['Apple', 18, 20, 14, 105.00],
33-
['Pear', 12, 12, 10, 96.00],
34-
['Cherry', 13, 14, 9, 105.00],
35-
['Apple', 14, 15, 10, 75.00],
36-
['Pear', 9, 8, 8, 76.80],
37-
['Apple', 8, 9, 6, 45.00],
38-
];
39-
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
40-
['="=Apple"', '>10', null, null, null, '<16'],
41-
['="=Pear"', null, null, null, null, null],
42-
];
28+
// Add some data
29+
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
30+
['Apple', 18, 20, 14, 105.00],
31+
['Pear', 12, 12, 10, 96.00],
32+
['Cherry', 13, 14, 9, 105.00],
33+
['Apple', 14, 15, 10, 75.00],
34+
['Pear', 9, 8, 8, 76.80],
35+
['Apple', 8, 9, 6, 45.00],
36+
];
37+
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
38+
['="=Apple"', '>10', null, null, null, '<16'],
39+
['="=Pear"', null, null, null, null, null],
40+
];
4341

44-
$worksheet->fromArray($criteria, null, 'A1');
45-
$worksheet->fromArray($database, null, 'A4');
42+
$worksheet->fromArray($criteria, null, 'A1');
43+
$worksheet->fromArray($database, null, 'A4');
4644

47-
$worksheet->setCellValue('A12', 'The Number of Apple trees over 10\' in height');
48-
$worksheet->setCellValue('B12', '=DCOUNT(A4:E10,"Yield",A1:B2)');
45+
$worksheet->setCellValue('A12', 'The Number of Apple trees over 10\' in height');
46+
$worksheet->setCellValue('B12', '=DCOUNT(A4:E10,"Yield",A1:B2)');
4947

50-
$worksheet->setCellValue('A13', 'The Number of Apple and Pear trees in the orchard');
51-
$worksheet->setCellValue('B13', '=DCOUNT(A4:E10,3,A1:A3)');
48+
$worksheet->setCellValue('A13', 'The Number of Apple and Pear trees in the orchard');
49+
$worksheet->setCellValue('B13', '=DCOUNT(A4:E10,3,A1:A3)');
5250

53-
echo '<hr />';
51+
echo '<hr />';
5452

55-
echo '<h4>Database</h4>';
53+
echo '<h4>Database</h4>';
5654

57-
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
58-
var_dump($databaseData);
55+
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
56+
var_dump($databaseData);
5957

60-
echo '<hr />';
58+
echo '<hr />';
6159

62-
// Test the formulae
63-
echo '<h4>Criteria</h4>';
60+
// Test the formulae
61+
echo '<h4>Criteria</h4>';
6462

65-
$criteriaData = $worksheet->rangeToArray('A1:B2', null, true, true, true);
66-
var_dump($criteriaData);
63+
$criteriaData = $worksheet->rangeToArray('A1:B2', null, true, true, true);
64+
var_dump($criteriaData);
6765

68-
echo $worksheet->getCell('A12')->getValue() . '<br />';
69-
echo 'DCOUNT() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
66+
echo $worksheet->getCell('A12')->getValue() . '<br />';
67+
echo 'DCOUNT() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
7068

71-
echo '<h4>Criteria</h4>';
69+
echo '<h4>Criteria</h4>';
7270

73-
$criteriaData = $worksheet->rangeToArray('A1:A3', null, true, true, true);
74-
var_dump($criteriaData);
71+
$criteriaData = $worksheet->rangeToArray('A1:A3', null, true, true, true);
72+
var_dump($criteriaData);
7573

76-
echo $worksheet->getCell('A13')->getValue() . '<br />';
77-
echo 'DCOUNT() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
78-
79-
?>
80-
<body>
74+
echo $worksheet->getCell('A13')->getValue() . '<br />';
75+
echo 'DCOUNT() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
76+
?>
77+
<body>
8178
</html>

docs/Examples/Calculations/Database/DGET.php

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,69 @@
66
set_time_limit(0);
77

88
date_default_timezone_set('Europe/London');
9-
109
?>
1110
<html>
12-
<head>
13-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
14-
15-
<title>PhpSpreadsheet Calculation Examples</title>
11+
<head>
12+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1613

17-
</head>
18-
<body>
14+
<title>PhpSpreadsheet Calculation Examples</title>
1915

20-
<h1>DGET</h1>
21-
<h2>Extracts a single value from a column of a list or database that matches conditions that you specify.</h2>
22-
<?php
16+
</head>
17+
<body>
2318

24-
require_once __DIR__ . '/../../../../src/Bootstrap.php';
19+
<h1>DGET</h1>
20+
<h2>Extracts a single value from a column of a list or database that matches conditions that you specify.</h2>
21+
<?php
22+
require_once __DIR__ . '/../../../../src/Bootstrap.php';
2523

26-
// Create new PhpSpreadsheet object
27-
$spreadsheet = new Spreadsheet();
28-
$worksheet = $spreadsheet->getActiveSheet();
24+
// Create new PhpSpreadsheet object
25+
$spreadsheet = new Spreadsheet();
26+
$worksheet = $spreadsheet->getActiveSheet();
2927

30-
// Add some data
31-
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
32-
['Apple', 18, 20, 14, 105.00],
33-
['Pear', 12, 12, 10, 96.00],
34-
['Cherry', 13, 14, 9, 105.00],
35-
['Apple', 14, 15, 10, 75.00],
36-
['Pear', 9, 8, 8, 76.80],
37-
['Apple', 8, 9, 6, 45.00],
38-
];
39-
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
40-
['="=Apple"', '>10', null, null, null, '<16'],
41-
['="=Pear"', null, null, null, null, null],
42-
];
28+
// Add some data
29+
$database = [['Tree', 'Height', 'Age', 'Yield', 'Profit'],
30+
['Apple', 18, 20, 14, 105.00],
31+
['Pear', 12, 12, 10, 96.00],
32+
['Cherry', 13, 14, 9, 105.00],
33+
['Apple', 14, 15, 10, 75.00],
34+
['Pear', 9, 8, 8, 76.80],
35+
['Apple', 8, 9, 6, 45.00],
36+
];
37+
$criteria = [['Tree', 'Height', 'Age', 'Yield', 'Profit', 'Height'],
38+
['="=Apple"', '>10', null, null, null, '<16'],
39+
['="=Pear"', null, null, null, null, null],
40+
];
4341

44-
$worksheet->fromArray($criteria, null, 'A1');
45-
$worksheet->fromArray($database, null, 'A4');
42+
$worksheet->fromArray($criteria, null, 'A1');
43+
$worksheet->fromArray($database, null, 'A4');
4644

47-
$worksheet->setCellValue('A12', 'The height of the Apple tree between 10\' and 16\' tall');
48-
$worksheet->setCellValue('B12', '=DGET(A4:E10,"Height",A1:F2)');
45+
$worksheet->setCellValue('A12', 'The height of the Apple tree between 10\' and 16\' tall');
46+
$worksheet->setCellValue('B12', '=DGET(A4:E10,"Height",A1:F2)');
4947

50-
echo '<hr />';
48+
echo '<hr />';
5149

52-
echo '<h4>Database</h4>';
50+
echo '<h4>Database</h4>';
5351

54-
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
55-
var_dump($databaseData);
52+
$databaseData = $worksheet->rangeToArray('A4:E10', null, true, true, true);
53+
var_dump($databaseData);
5654

57-
echo '<hr />';
55+
echo '<hr />';
5856

59-
// Test the formulae
60-
echo '<h4>Criteria</h4>';
57+
// Test the formulae
58+
echo '<h4>Criteria</h4>';
6159

62-
echo 'ALL' . '<br /><br />';
60+
echo 'ALL' . '<br /><br />';
6361

64-
echo $worksheet->getCell('A12')->getValue() . '<br />';
65-
echo 'DMAX() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
62+
echo $worksheet->getCell('A12')->getValue() . '<br />';
63+
echo 'DMAX() Result is ' . $worksheet->getCell('B12')->getCalculatedValue() . '<br /><br />';
6664

67-
echo '<h4>Criteria</h4>';
65+
echo '<h4>Criteria</h4>';
6866

69-
$criteriaData = $worksheet->rangeToArray('A1:A2', null, true, true, true);
70-
var_dump($criteriaData);
67+
$criteriaData = $worksheet->rangeToArray('A1:A2', null, true, true, true);
68+
var_dump($criteriaData);
7169

72-
echo $worksheet->getCell('A13')->getValue() . '<br />';
73-
echo 'DMAX() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
74-
75-
?>
76-
<body>
70+
echo $worksheet->getCell('A13')->getValue() . '<br />';
71+
echo 'DMAX() Result is ' . $worksheet->getCell('B13')->getCalculatedValue();
72+
?>
73+
<body>
7774
</html>

0 commit comments

Comments
 (0)