@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | // Set document properties |
53 | 53 | echo date('H:i:s') , " Set properties" , EOL; |
54 | 54 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
55 | - ->setLastModifiedBy("Maarten Balliauw") |
|
56 | - ->setTitle("Office 2007 XLSX Test Document") |
|
57 | - ->setSubject("Office 2007 XLSX Test Document") |
|
58 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
59 | - ->setKeywords("office 2007 openxml php") |
|
60 | - ->setCategory("Test result file"); |
|
55 | + ->setLastModifiedBy("Maarten Balliauw") |
|
56 | + ->setTitle("Office 2007 XLSX Test Document") |
|
57 | + ->setSubject("Office 2007 XLSX Test Document") |
|
58 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
59 | + ->setKeywords("office 2007 openxml php") |
|
60 | + ->setCategory("Test result file"); |
|
61 | 61 | |
62 | 62 | |
63 | 63 | // Create a first sheet |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | // Set outline levels |
80 | 80 | echo date('H:i:s') , " Set outline levels" , EOL; |
81 | 81 | $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1) |
82 | - ->setVisible(false) |
|
83 | - ->setCollapsed(true); |
|
82 | + ->setVisible(false) |
|
83 | + ->setCollapsed(true); |
|
84 | 84 | |
85 | 85 | // Freeze panes |
86 | 86 | echo date('H:i:s') , " Freeze panes" , EOL; |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | |
95 | 95 | // Add data |
96 | 96 | for ($i = 2; $i <= 5000; $i++) { |
97 | - $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i") |
|
98 | - ->setCellValue('B' . $i, "LName $i") |
|
99 | - ->setCellValue('C' . $i, "PhoneNo $i") |
|
100 | - ->setCellValue('D' . $i, "FaxNo $i") |
|
101 | - ->setCellValue('E' . $i, true); |
|
97 | + $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i") |
|
98 | + ->setCellValue('B' . $i, "LName $i") |
|
99 | + ->setCellValue('C' . $i, "PhoneNo $i") |
|
100 | + ->setCellValue('D' . $i, "FaxNo $i") |
|
101 | + ->setCellValue('E' . $i, true); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | |
40 | 40 | if (!file_exists("05featuredemo.xlsx")) { |
41 | - exit("Please run 05featuredemo.php first." . EOL); |
|
41 | + exit("Please run 05featuredemo.php first." . EOL); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | echo date('H:i:s') , " Load from Excel2007 file" , EOL; |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | $objPHPExcel = new \PHPExcel\Spreadsheet(); |
44 | 44 | $objWorksheet = $objPHPExcel->getActiveSheet(); |
45 | 45 | $objWorksheet->fromArray( |
46 | - array( |
|
47 | - array('', 2010, 2011, 2012), |
|
48 | - array('Q1', 12, 15, 21), |
|
49 | - array('Q2', 56, 73, 86), |
|
50 | - array('Q3', 52, 61, 69), |
|
51 | - array('Q4', 30, 32, 0), |
|
52 | - ) |
|
46 | + array( |
|
47 | + array('', 2010, 2011, 2012), |
|
48 | + array('Q1', 12, 15, 21), |
|
49 | + array('Q2', 56, 73, 86), |
|
50 | + array('Q3', 52, 61, 69), |
|
51 | + array('Q4', 30, 32, 0), |
|
52 | + ) |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | // Set the Labels for each data series we want to plot |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | // Data values |
61 | 61 | // Data Marker |
62 | 62 | $dataSeriesLabels = array( |
63 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), // 2010 |
|
64 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 2011 |
|
65 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 2012 |
|
63 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), // 2010 |
|
64 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), // 2011 |
|
65 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), // 2012 |
|
66 | 66 | ); |
67 | 67 | // Set the X-Axis Labels |
68 | 68 | $xAxisTickValues = array( |
69 | - new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), // Q1 to Q4 |
|
69 | + new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), // Q1 to Q4 |
|
70 | 70 | ); |
71 | 71 | // Set the Data values for each data series we want to plot |
72 | 72 | // Datatype |
@@ -76,22 +76,22 @@ discard block |
||
76 | 76 | // Data values |
77 | 77 | // Data Marker |
78 | 78 | $dataSeriesValues = array( |
79 | - new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4), |
|
80 | - new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4), |
|
81 | - new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4), |
|
79 | + new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4), |
|
80 | + new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4), |
|
81 | + new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4), |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | // Build the dataseries |
85 | 85 | $series = new \PHPExcel\Chart\DataSeries( |
86 | - \PHPExcel\Chart\DataSeries::TYPE_SCATTERCHART, // plotType |
|
87 | - NULL, // plotGrouping (Scatter charts don't have any grouping) |
|
88 | - range(0, count($dataSeriesValues)-1), // plotOrder |
|
89 | - $dataSeriesLabels, // plotLabel |
|
90 | - $xAxisTickValues, // plotCategory |
|
91 | - $dataSeriesValues, // plotValues |
|
86 | + \PHPExcel\Chart\DataSeries::TYPE_SCATTERCHART, // plotType |
|
87 | + NULL, // plotGrouping (Scatter charts don't have any grouping) |
|
88 | + range(0, count($dataSeriesValues)-1), // plotOrder |
|
89 | + $dataSeriesLabels, // plotLabel |
|
90 | + $xAxisTickValues, // plotCategory |
|
91 | + $dataSeriesValues, // plotValues |
|
92 | 92 | NULL, // plotDirection |
93 | - NULL, // smooth line |
|
94 | - \PHPExcel\Chart\DataSeries::STYLE_LINEMARKER // plotStyle |
|
93 | + NULL, // smooth line |
|
94 | + \PHPExcel\Chart\DataSeries::STYLE_LINEMARKER // plotStyle |
|
95 | 95 | ); |
96 | 96 | |
97 | 97 | // Set the series in the plot area |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | |
106 | 106 | // Create the chart |
107 | 107 | $chart = new \PHPExcel\Chart( |
108 | - 'chart1', // name |
|
109 | - $title, // title |
|
110 | - $legend, // legend |
|
111 | - $plotArea, // plotArea |
|
112 | - true, // plotVisibleOnly |
|
113 | - 0, // displayBlanksAs |
|
114 | - NULL, // xAxisLabel |
|
115 | - $yAxisLabel // yAxisLabel |
|
108 | + 'chart1', // name |
|
109 | + $title, // title |
|
110 | + $legend, // legend |
|
111 | + $plotArea, // plotArea |
|
112 | + true, // plotVisibleOnly |
|
113 | + 0, // displayBlanksAs |
|
114 | + NULL, // xAxisLabel |
|
115 | + $yAxisLabel // yAxisLabel |
|
116 | 116 | ); |
117 | 117 | |
118 | 118 | // Set the position where the chart should appear in the worksheet |
@@ -45,12 +45,12 @@ |
||
45 | 45 | // Set document properties |
46 | 46 | echo date('H:i:s') , " Set document properties" , EOL; |
47 | 47 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
48 | - ->setLastModifiedBy("Maarten Balliauw") |
|
49 | - ->setTitle("Office 2007 XLSX Test Document") |
|
50 | - ->setSubject("Office 2007 XLSX Test Document") |
|
51 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
52 | - ->setKeywords("office 2007 openxml php") |
|
53 | - ->setCategory("Test result file"); |
|
48 | + ->setLastModifiedBy("Maarten Balliauw") |
|
49 | + ->setTitle("Office 2007 XLSX Test Document") |
|
50 | + ->setSubject("Office 2007 XLSX Test Document") |
|
51 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
52 | + ->setKeywords("office 2007 openxml php") |
|
53 | + ->setCategory("Test result file"); |
|
54 | 54 | |
55 | 55 | |
56 | 56 | // Add some data |
@@ -45,12 +45,12 @@ |
||
45 | 45 | // Set document properties |
46 | 46 | echo date('H:i:s') , " Set document properties" , EOL; |
47 | 47 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
48 | - ->setLastModifiedBy("Maarten Balliauw") |
|
49 | - ->setTitle("Office 2007 XLSX Test Document") |
|
50 | - ->setSubject("Office 2007 XLSX Test Document") |
|
51 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
52 | - ->setKeywords("office 2007 openxml php") |
|
53 | - ->setCategory("Test result file"); |
|
48 | + ->setLastModifiedBy("Maarten Balliauw") |
|
49 | + ->setTitle("Office 2007 XLSX Test Document") |
|
50 | + ->setSubject("Office 2007 XLSX Test Document") |
|
51 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
52 | + ->setKeywords("office 2007 openxml php") |
|
53 | + ->setCategory("Test result file"); |
|
54 | 54 | |
55 | 55 | |
56 | 56 | // Add some data |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | date_default_timezone_set('Europe/London'); |
33 | 33 | |
34 | 34 | if (PHP_SAPI == 'cli') |
35 | - die('This example should only be run from a Web Browser'); |
|
35 | + die('This example should only be run from a Web Browser'); |
|
36 | 36 | |
37 | 37 | /** Include PHPExcel */ |
38 | 38 | require_once dirname(__FILE__) . '/../src/Bootstrap.php'; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | |
44 | 44 | // Set document properties |
45 | 45 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
46 | - ->setLastModifiedBy("Maarten Balliauw") |
|
47 | - ->setTitle("Office 2007 XLSX Test Document") |
|
48 | - ->setSubject("Office 2007 XLSX Test Document") |
|
49 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
50 | - ->setKeywords("office 2007 openxml php") |
|
51 | - ->setCategory("Test result file"); |
|
46 | + ->setLastModifiedBy("Maarten Balliauw") |
|
47 | + ->setTitle("Office 2007 XLSX Test Document") |
|
48 | + ->setSubject("Office 2007 XLSX Test Document") |
|
49 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
50 | + ->setKeywords("office 2007 openxml php") |
|
51 | + ->setCategory("Test result file"); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | // Add some data |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | |
40 | 40 | if (!file_exists("05featuredemo.xlsx")) { |
41 | - exit("Please run 05featuredemo.php first." . EOL); |
|
41 | + exit("Please run 05featuredemo.php first." . EOL); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | echo date('H:i:s') , " Load from Excel2007 file" , EOL; |
@@ -44,12 +44,12 @@ |
||
44 | 44 | // Set document properties |
45 | 45 | echo date('H:i:s') , " Set document properties" , EOL; |
46 | 46 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
47 | - ->setLastModifiedBy("Maarten Balliauw") |
|
48 | - ->setTitle("PHPExcel Test Document") |
|
49 | - ->setSubject("PHPExcel Test Document") |
|
50 | - ->setDescription("Test document for PHPExcel, generated using PHP classes.") |
|
51 | - ->setKeywords("office PHPExcel php") |
|
52 | - ->setCategory("Test result file"); |
|
47 | + ->setLastModifiedBy("Maarten Balliauw") |
|
48 | + ->setTitle("PHPExcel Test Document") |
|
49 | + ->setSubject("PHPExcel Test Document") |
|
50 | + ->setDescription("Test document for PHPExcel, generated using PHP classes.") |
|
51 | + ->setKeywords("office PHPExcel php") |
|
52 | + ->setCategory("Test result file"); |
|
53 | 53 | |
54 | 54 | |
55 | 55 | // Add some data |
@@ -47,30 +47,30 @@ |
||
47 | 47 | // Set document properties |
48 | 48 | echo date('H:i:s') , " Set document properties" , EOL; |
49 | 49 | $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") |
50 | - ->setLastModifiedBy("Maarten Balliauw") |
|
51 | - ->setTitle("Office 2007 XLSX Test Document") |
|
52 | - ->setSubject("Office 2007 XLSX Test Document") |
|
53 | - ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
54 | - ->setKeywords("office 2007 openxml php") |
|
55 | - ->setCategory("Test result file"); |
|
50 | + ->setLastModifiedBy("Maarten Balliauw") |
|
51 | + ->setTitle("Office 2007 XLSX Test Document") |
|
52 | + ->setSubject("Office 2007 XLSX Test Document") |
|
53 | + ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") |
|
54 | + ->setKeywords("office 2007 openxml php") |
|
55 | + ->setCategory("Test result file"); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | // Create a first sheet |
59 | 59 | echo date('H:i:s') , " Add data" , EOL; |
60 | 60 | $objPHPExcel->setActiveSheetIndex(0); |
61 | 61 | $objPHPExcel->getActiveSheet()->setCellValue('A1', "Cell B3 and B5 contain data validation...") |
62 | - ->setCellValue('A3', "Number:") |
|
63 | - ->setCellValue('B3', "10") |
|
64 | - ->setCellValue('A5', "List:") |
|
65 | - ->setCellValue('B5', "Item A") |
|
66 | - ->setCellValue('A7', "List #2:") |
|
67 | - ->setCellValue('B7', "Item #2") |
|
68 | - ->setCellValue('D2', "Item #1") |
|
69 | - ->setCellValue('D3', "Item #2") |
|
70 | - ->setCellValue('D4', "Item #3") |
|
71 | - ->setCellValue('D5', "Item #4") |
|
72 | - ->setCellValue('D6', "Item #5") |
|
73 | - ; |
|
62 | + ->setCellValue('A3', "Number:") |
|
63 | + ->setCellValue('B3', "10") |
|
64 | + ->setCellValue('A5', "List:") |
|
65 | + ->setCellValue('B5', "Item A") |
|
66 | + ->setCellValue('A7', "List #2:") |
|
67 | + ->setCellValue('B7', "Item #2") |
|
68 | + ->setCellValue('D2', "Item #1") |
|
69 | + ->setCellValue('D3', "Item #2") |
|
70 | + ->setCellValue('D4', "Item #3") |
|
71 | + ->setCellValue('D5', "Item #4") |
|
72 | + ->setCellValue('D6', "Item #5") |
|
73 | + ; |
|
74 | 74 | |
75 | 75 | |
76 | 76 | // Set data validation |