Convert the data to XML Excel
Definition at line 13 of file Excel.php.
◆ __construct()
__construct |
( |
\Iterator |
$iterator, |
|
|
|
$rowCallback = [] |
|
) |
| |
Class Constructor
- Parameters
-
\Iterator | $iterator | |
array | $rowCallback | |
Definition at line 49 of file Excel.php.
52 $this->_rowCallback = $rowCallback;
◆ _getXmlFooter()
Retrieve Excel XML Document Footer XML Fragment Append data footer if it is available
- Returns
- string
Definition at line 105 of file Excel.php.
109 if ($this->_dataFooter) {
110 $xmlFooter = $this->_getXmlRow($this->_dataFooter,
false);
113 $xmlFooter .=
'</Table></Worksheet></Workbook>';
◆ _getXmlHeader()
_getXmlHeader |
( |
|
$sheetName = '' | ) |
|
|
protected |
Retrieve Excel XML Document Header XML Fragment Append data header if it is available
- Parameters
-
- Returns
- string
Definition at line 62 of file Excel.php.
64 if (empty($sheetName)) {
65 $sheetName =
'Sheet 1';
68 $sheetName = htmlspecialchars($sheetName);
71 '?xml version="1.0"?' .
73 '?mso-application progid="Excel.Sheet"?' .
75 ' xmlns="urn:schemas-microsoft-com:office:spreadsheet"' .
76 ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' .
77 ' xmlns:x="urn:schemas-microsoft-com:office:excel"' .
78 ' xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml"' .
79 ' xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"' .
80 ' xmlns:o="urn:schemas-microsoft-com:office:office"' .
81 ' xmlns:html="http://www.w3.org/TR/REC-html40"' .
82 ' xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet">' .
83 '<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">' .
84 '</OfficeDocumentSettings>' .
85 '<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">' .
87 '<Worksheet ss:Name="' .
92 if ($this->_dataHeader) {
93 $xmlHeader .= $this->_getXmlRow($this->_dataHeader,
false);
◆ convert()
convert |
( |
|
$sheetName = '' | ) |
|
Convert Data to Excel XML Document
- Parameters
-
- Returns
- string
Definition at line 192 of file Excel.php.
196 foreach ($this->_iterator as $dataRow) {
197 $xml .= $this->_getXmlRow($dataRow,
true);
_getXmlHeader($sheetName='')
◆ setDataFooter()
Set Data Footer
- Parameters
-
- Returns
- void
Definition at line 181 of file Excel.php.
183 $this->_dataFooter =
$data;
◆ setDataHeader()
Set Data Header
- Parameters
-
- Returns
- void
Definition at line 170 of file Excel.php.
172 $this->_dataHeader =
$data;
◆ write()
Write Converted XML Data to Temporary File
- Parameters
-
WriteInterface | $stream | |
string | $sheetName | |
- Returns
- void
Definition at line 211 of file Excel.php.
215 foreach ($this->_iterator as $dataRow) {
216 $stream->write($this->_getXmlRow($dataRow,
true));
_getXmlHeader($sheetName='')
◆ $_dataFooter
◆ $_dataHeader
◆ $_iterator
◆ $_rowCallback
The documentation for this class was generated from the following file: