PHPExcel Development Documentation
PHPExcel Development Documentation
PCAN I REMOVE THIS DEPENDENCY TO WRITE EXCEL?2007FILES(NOT FOR READING) THROUGH THE USE OF THE
LIBRARY PCL ZIP THAT IS INCLUDED WITH PHP EXCEL. SEE THE FAQ SECTION OF THIS DOCUMENT (2.4.2) FOR DETAILS
ABOUT THIS. VTHIS IS THE FAQ SECTION OF THIS DOCUMENT(2.4.2)FOR MORE DETAILS ABOUT THIS.
PCLZIP DOES HAVE A DEPENDENCY ON PHP’S ZLIB EXTENSION BEING ENABLED. PCLZIP HAS A DEPENDENCY ON ZLIB.
EXTENSIONPHPIS ENABLING5
2.1. LINSTALLATION INSTRUCTIONS5
2.2. PFIRST STEPS5
2.3. EUSEFUL PLACES AND TOOLS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1. OpenXML / SpreadsheetML
2.3.2. Frequently Asked Questions...............................................................................................6
2.3.3. Tutorials................................................................................................................................................9
3. ARCHITECTURE...........................................................................................................................................10
3.1. ESCHEMATIC..................................................................................................................................................10
3.2. LAZYLOADER10
3.3. SPREADSHEET(HSHEET OFCCALCULATION) IN MEMORY10
3.4. EWRITING ANDLLECTURE......................................................................................................................................11
3.5. FLIQUID INTERFACES...........................................................................................................................................12
4. CREATION FROM A SPREADSHEET..............................................................14
4.1. LTo classPHPEXCEL14
4.2. TheCONFIGURATION OPTIONS.............................................................................................................................14
4.2.1. Caching of a cell...........................................................................................14
4.2.2. Language / Regional settings..........................................................................................................16
4.3. EREMOVAL OF A BOOK FROM THE MEMORY..........................................................................................................17
4.4. WWORKSHEETS17
4.5. AACCESSING CELLS17
4.5.1. Setting a cell value by coordinate.........................................................17
4.5.2. Recovery of a coordinate cell........................................................................................17
4.5.3. The establishment of a cell value in the column and row..........................................................17
4.5.4. Retrieval of a cell by column and row....................................................................................18
4.5.5. Looping cells......................................................................................................................................18
4.5.6. Use of value folders to facilitate data entry.................................19
4.6. PHPEXCEL RECIPES.........................................................................................................................................20
4.6.1. Spreadsheet framework of the metadata of a................................................................................20
4.6.2. Sheet frame of a spreadsheet
4.6.3. Write a date in a cell............................................................................................................21
4.6.4. Write a formula in a cell.......................................................................................................22
4.6.5. Regional settings for the preparations in..................................................................................22
4.6.6. Write a newline character "\n" in a cell (Alt + Enter)..................................................23
4.6.7. Explicitly set the data type of a cell..........................................................................24
4.6.8. Change a cell in a URL click on......................................................................24
4.6.9. Page orientation of a spreadsheet and size.......................................................24
4.6.10. Configure page: Options scale.............................................................................................24
4.6.11. Margin page............................................................................................................................25
4.6.12. Center of a horizontal / vertical page.........................................................................................26
4.6.13. Adjustment of the header and footer for printing a spreadsheet.....................................26
4.6.14. Marco breaks the print in a row or column..............................................................................28
4.6.15. Show or hide print division lines when................................................................28
4.6.16. Set rows/columns to repeat at the top/left.
4.6.17. Specify the print area........................................................................................................29
4.6.18. Cell format...............................................................................................................................29
4.6.19. Number of formats ............................................................................................................................30
4.6.20. Align and adjust the text...............................................................................................................31
You can remove this dependency to write Excel 2007 files (not for reading) using
the PCLZip library included with PHPExcel. See the FAQ section of this document (2.4.2)
for details about this. See the frequently asked questions section of this document.2.4.2) for
more details about this. PCLZip does have a dependency on PHP’s zlib extension being enabled.
PCLZip has a dependency on zlib PHP extension being enabled.
The installation is very easy: copy the contents of the classes folder to any location
Example:
If your web root directory is / var / www / you may want to create a subfolder called / var / www / classes / and copy the
files in that folder because they end with the files:
/var/www/Classes/[Link]
/var/www/Classes/PHPExcel/[Link]
/var/www/Classes/PHPExcel/[Link]
...
Copy the 'Tests' folder next to your 'Classes' folder from above so that they end with:
/var/www/Tests/[Link]
/var/www/Tests/[Link]
...
[Link]
The provided text appears to be a URL and does not contain translatable content.
...
Note: It may be necessary to modify the inclusion or requirement of declarations at the beginning of each of the test scripts if your 'Classes' ...
the folder above is called something else.
The ZipArchive class is only necessary when reading or writing that use formats of
Zip compression (excel2007 and OOCalc). Since version 1.7.6 the PCLZip library has been bundled with
PHPExcel as an alternative to the ZipArchive class. Since version 1.7.6 of the PCLZip library has
included with PHPExcel as an alternative to the ZipArchive class.
Currently, this only allows you to write excel2007 files without the need for ZipArchive.
read excel2007 or OOCalc
Excel found unreadable content in '*.xlsx'. Do you want to recover the contents of this?
workbook? Do you want to recover the content of this book? If you trust the source of this workbook,
Click Yes. If you trust the source of this book, click Yes.
Some versions of the php_zip extension on Windows contain a bug when creating ZIP files.
version that can be found on[Link] work at
all times. The version that can be found in[Link]
[Link] must work at all times.
On the other hand, the update to at least PHP 5.2.9 should resolve the issue.
If you cannot find a clean copy of ZipArchive, then you can use the library
PCLZip as an alternative to writing excel2007 files, as described above.
Some readers and writers are faster than others, and they also use different
memory amounts. 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 boardYou can find some indications regarding relative performance and usage
from memory for the different readers and writers, about the different versions of PHPExcel, in
thedebate forum.
If you have already increased the memory to a maximum, or cannot change its memory limit,
sothis discussionthe forum describes some of the methods that can be applied to
reduce the memory usage of scripts using PHPExcel.
Not all of the features of PHPExcel apply to all Reader class / writer.
mostly due to underlying libraries not supporting a specific feature or not having implemented a
specific feature. This is mainly due to the underlying libraries not supporting a
specific characteristic or not having applied a specific characteristic.
For example, Autofilter is not implemented in PERA Spreadsheet_Excel_writer, which is the basis of
our writer Excel5.
Little by little we are creating a list of features, along with the different readers and
writers who support them, in the "[Link]" functionality file in the folder of
documentation /.
This is normal behavior for the compatibility package, excel2007 shows this
Use PHPExcel_Writer_Excel5 if you really need calculated values, or force
Recalculation in Excel2003. PHPExcel_Writer_Excel5 use if you really need the values.
calculated, or of current calculation in Excel 2003.
Trying to set the column width, an experience problem. When I open the file in
Excel, the actual width is 0.71 less than it should be. When I open the file in Excel, the actual width
It is 0.71 less than it should be.
The short answer is that PHPExcel uses a measurement that includes padding.
See the section: 'Column width frame' for more details.
obtain more details.
There are some instructions for using PHPExcel with Joomla in theJoomla! Forum
A page of advice on usingPHPExcel in the Yii frameworkA tips page on the use of
PHPExcel in the Yii framework
The Bakeryhas some helper classes for reading and writing with PHPExcel within CakePHPThe
bakeryIt has some helper classes for reading and writing with PHPExcel in CakePHP.
IntegratingPHPExcel into Kohana[Link]
kohana-3/ andIntegration of PHPExcel and Kohana FrameworkThe integration ofPHPExcel in Kohana
[Link] andIntegration of PHPExcel and
Kohana Framework
UsingPHPExcel with Typo3UsingPHPExcel with Typo3
Thanks to peterrlynch for the following advice on resolving issues between thePHPExcel autoloader
and Joomla AutoloaderThanks to peterrlynch for the following tips on resolving issues.
between thecharger and the automatic charger PHPExcel Joomla
[Link] [Link]
If your own scripts already define an autoload function, then this can be
overwritten by the PHPExcel autoload function. For example, if you have: For example, if
you have:
function __autoload($class) {
...
}
Do this instead:
function myAutoload($class) {
...
}
spl_autoload_register('myAutoload');
By default, the PHPExcel package provides some readers and writers, among
they one for the spreadsheet in Open XML format (also known as file format
from Excel 2007).
You are not limited to the default readers and writers, as they are free to apply the
PHPExcel_Writer_IReader and the PHPExcel_Writer_IWriter interface in a custom class.
This means that you can easily 'chain' calls to specific methods without
need for a new PHP declaration.
This means that you can easily 'chain' calls to specific methods without
need for a new PHP declaration For example, let's take the following code:
$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");
Test document for Office 2007 XLSX,
generated using PHP classes.
$objPHPExcel->getProperties()->setKeywords("office 2007 openxml php");
$objPHPExcel->getProperties()
->setCreator("Maarten Balliauw")
->setLastModifiedBy("Maarten Balliauw")
->setTitle("Office 2007 XLSX Test Document")
->setSubject("Office 2007 XLSX Test Document")
->setDescription("Test document for Office 2007 XLSX, generated using
PHP classes.
->setKeywords("office 2007 openxml php")
->setCategory("Test result file");
The PHPExcel class is the core of PHPExcel.. It contains references to the spreadsheets listed.
in the document the security settings and metadata of the document.
To simplify the PHPExcel concept: the PHPExcel class represents the workbook.
PHPExcel_CachedObjectStorageFactory::cache_in_memory
PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
setCacheStorageMethod() will return a boolean true if successful, false in case of failure (for
example, if trying to cache to APC while APC is not enabled.
The cache is maintained separately for each individual spreadsheet, and it is created
automatically when a spreadsheet instance is created based on the method of
cached storage and the configuration that you have set up. You cannot change the
configuration settings once they have started reading a book, or have created their first sheet
of calculation.
PHPExcel_CachedObjectStorageFactory::cache_in_memory;
The default value. If you do not initialize any caching method, then this
It is the method that PHPExcel will use. Cell objects are maintained in PHP memory as at present.
the cell is kept in PHP memory as it is today.
PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized;
The use of this caching method keeps the cells in PHP memory.
like a set of objects in series, which reduces the memory footprint with overhead of
PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp
$cacheSettings = array( ' memoryCacheSize ' => '8MB'
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
The php: // temporary file is automatically deleted when the script ends.
PHPExcel_CachedObjectStorageFactory::cache_to_apc;
When cache_to_apc is used, cell objects are kept inaAPC with only one index
keeps in PHP memory to determine that the cell exists. By default, a time of
a cache wait of 600 seconds is used, which should be sufficient for most of the
applications: although it is possible to change this when initializing cache_to_APC.
PHPExcel_CachedObjectStorageFactory::cache_to_APC
$cacheSettings = array( 'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When the script sequence ends, all entries will be removed from APC, with
independence of the cacheTime value, so it cannot be used for storage
persistent using this mechanism.
PHPExcel_CachedObjectStorageFactory::cache_to_memcache
PHPExcel_CachedObjectStorageFactory::cache_to_memcache
$cacheSettings = array( 'memcacheServer' => 'localhost',
'memcachePort' => 11211,
'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When the script sequence ends, all entries will be removed from memcache.
regardless of the cacheTime value, so it cannot be used for storage
persistent using this mechanism.
PHPExcel_CachedObjectStorageFactory::cache_to_wincache;
When cache_to_wincache is used, cell objects are kept in WinCache.3with just a
index is maintained in PHP memory to determine that the cell exists. by default, a time
A WinCache cache wait of 600 seconds is used, which should be sufficient for most.
from the applications: although it is possible to change this initialization cache_to_wincache
when.
PHPExcel_CachedObjectStorageFactory::cache_to_wincache
$cacheSettings = array( 'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When the script sequence ends, all entries will be removed from WinCache.
regardless of the cacheTime value, it cannot be used for storage
persistent using this mechanism.
pt_br
PHPExcel_Settings::setLocale($locale);
if (!$validLocale) {
Unable to set locale to
}
If the Brazilian Portuguese language files are not available, then the Portuguese ones are.
it will be enabled in its place: if the Portuguese language files are not available, then setlocale
() method will return an error, and the American English (es_es) setting is used throughout. More
details of the available functions once the regional settings have been established, including
a list of the languages and regional settings currently supported can be found at
the section4.5.5Locale Settings for Formulae. Regional settings for preparations.
This can only be solved manually: if it is necessary to disassemble a book, then also
You have to "break" these circular references before doing it. PHPExcel provides the
disconnectWorksheets() method for this purpose. PHPExcel provides the disconnectWorksheets()
for this purpose.
$objPHPExcel->disconnectWorksheets();
unset($objPHPExcel);
4.4. Worksheets
A spreadsheet is a collection of cells, formulas, images, graphs, ... It has all the
data you want to represent as a spreadsheet.
$objPHPExcel->getActiveSheet()->getCell('B8')->getValue();
If you need the calculated value of a cell, use the following code. This is explained in
4.4.35.
$objPHPExcel->getActiveSheet()->getCell('B8')->getCalculatedValue();
4.5.3. The establishment of a cell value in the column and the row
Setting a cell value by coordinates can be done using a spreadsheet.
desetCellValueByColumnAndRow method.
Set cell B8
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, 8, 'Some value');
// Get cell B8
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow(1, 8)->getValue();
If you need the calculated value of a cell, use the following code. This is explained in
4.4.35
Get cell B8
$objPHPExcel->getActiveSheet()->getCellByColumnAndRow(1, 8)->getCalculatedValue();
The easiest way to loop cells is by using iterators. By using iterators, one can use
foreach for spreadsheet loop, rows and cells.
The following is an example where all the values of a spreadsheet are read and
shows them in a table.
<?php
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("[Link]");
$objWorksheet = $objPHPExcel->getActiveSheet();
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(false); // This loops through all the
cells
Although it is not established.
By default,
only the cells
That they are one
Iterate.
foreach ($cellIterator as $cell) {
echo '<td>' . $cell->getValue() . '</td>' . "\n";
}
You can use the ability to access cell values and the column index row.
like (0,1) instead of 'A1' to read and write values of the cells in loops.
Note: The index of the PHPExcel column is based on 0, while the row index
It's based on 1. That means 'A1' ~ (0,1) It means 'A1' ~ (0,1)
Below is an example where all the values of a spreadsheet are read and the
show in a table.
<?php
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("[Link]");
$objWorksheet = $objPHPExcel->getActiveSheet();
$objWorksheet->getHighestRow(); // example 10
$highestColumn = $objWorksheet->getHighestColumn(); // example 'F'
PHPExcel
require_once '[Link]';
PHPExcel_IOFactory
require_once 'PHPExcel/[Link]';
// ...
Percentage value:
$objPHPExcel->getActiveSheet()->setCellValue('B4', '10%');
Convert to 0.1 and percentage cell style sets
$objPHPExcel->getActiveSheet()->setCellValue('A5', 'Date/time value:');
December 21, 1983
Convert to the date and set the cell style date format
For example,4.4.7 Setting a worksheet's page orientation and sizecovers setting a page orientation
to [Link] orientation framework and the size of a spreadsheetit covers establishing a
A4 page orientation. Other paper formats, such as US Letter, are not covered in this.
document, but in the PHPExcel API documentation.
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw");
$objPHPExcel->getProperties()->setLastModifiedBy("Maarten Balliauw");
$objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Test Document");
Office 2007 XLSX Test Document
Test document for Office 2007 XLSX,
generated using PHP classes.
$objPHPExcel->getProperties()->setKeywords("office 2007 openxml php");
$objPHPExcel->getProperties()->setCategory("Test result file");
$objPHPExcel->setActiveSheetIndex(0);
Writing a date value in a cell consists of two lines of code. Select the method
what suits him best. Here are some examples:
Excel in time
$objPHPExcel->getActiveSheet()->setCellValue('D1', 39813)
$objPHPExcel->getActiveSheet()->getStyle('D1')->getNumberFormat()-
setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH)
The previous methods for entering a date all yield the same result.
PHPExcel_Style_NumberFormat provides a large number of predefined date formats.
Notes:
See the section "Using value folders to facilitate data entry" for more.
Information about the AdvancedValueBinder used in the first example.
Excel can also operate on a 1904 date system (default for workbooks
saved on Mac). Normally, you don't have to worry about this when you
use PHPExcel.
This is regardless of the language version of Microsoft Office Excel that may have been.
used to create the Excel file.
At the end of the book, it opens by the user, Microsoft Office Excel will take care of displaying the formula
according to the language applications. Translation is taken care of by the application!
application load!
The following line of code writes the formula "= IF (C4> 500, " profit ", " loss ")" in cell B8.
Note that the formula must start with "=" for PHPExcel to recognize this as
a formula.
$objPHPExcel->getActiveSheet()->setCellValue('B8','=IF(C4>500,"profit","loss")');
Cells from formula A can be read again with the following line of code:
$formula = $objPHPExcel->getActiveSheet()->getCell('B8')->getValue();
If you need the calculated value of a cell, use the following code. This is explained in
4.4.35.
$value = $objPHPExcel->getActiveSheet()->getCell('B8')->getCalculatedValue();
ru
PHPExcel_Settings::setLocale($locale);
if (!$validLocale) {
Unable to set locale to
}
If the language of the Russian files is not available, the setlocale() method will return an error, and
The English setting will be used everywhere.
Once you have set a regional setting, you can translate a formula from within it.
English coding.
$formula = $objPHPExcel->getActiveSheet()->getCell('B8')->getValue();
translatedFormula
PHPExcel_Calculation::getInstance()->_translateFormulaToLocale($formula);
=DAYS360(DATE(2010,2,5),DATE(2010,12,31),TRUE)
$internalFormula
PHPExcel_Calculation::getInstance()->translateFormulaToEnglish($formula);
$objPHPExcel->getActiveSheet()->setCellValue('B8',$internalFormula);
Currently, the translation only translates the formula names of the functions, the constants
TRUE and FALSE, and the argument separators of the function.
hello\nworld
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true);
Tip
Learn more about cell formatting using getStyle() elsewhere.
Tip
[Link] automatically enables "wrap text" of the cell when viewed a
newline character in a string that will be inserted into a cell. Just like Microsoft Office Excel.
just like Microsoft Office Excel. Try this:
require_once 'PHPExcel/Cell/[Link]';
PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );
hello world
You can explicitly set a cell's data type using the setValueExplicit method of
the cell, or the setCellValueExplicit method of a spreadsheet. Here is an example: of the
United Nations:
$objPHPExcel->getActiveSheet()->getCell('A1')->setValueExplicit('25',
PHPExcel_Cell_DataType::TYPE_NUMERIC;
$objPHPExcel->getActiveSheet()->setCellValue('E26', '[Link]');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()-
>setUrl('[Link]
If you want to create a hyperlink to another spreadsheet or cell, use the following
code:
$objPHPExcel->getActiveSheet()->setCellValue('E26', '[Link]');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()-
>setUrl("sheet://'Sheetname'!A1");
Page orientation of a spreadsheet and the size can be adjusted using the
following lines of code:
$objPHPExcel->getActiveSheet()->getPageSetup()-
setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()-
setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
Please note that there are additional page options available. Please consult the
API documentation for all possible options.
The page scale configuration options in PHPExcel are directly related to the
scale options in the 'Page Setup' section of the dialog as shown in the illustration.
The default values in PHPExcel correspond to the default values of MS Office Excel, such as
it is shown in the illustration
Example
$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToWidth(1);
$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(0);
As you can see, it is not necessary to call asetFitToPage (true) from setFitToWidth.
(...) ysetFitToHeight (...) causes this.
$objPHPExcel->getActiveSheet()->getPageSetup()->setHorizontalCentered(true);
$objPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false);
Marco printing sheet of a header and footer can be done using the following
lines of code:
&C&HPlease treat
this document as confidential!
$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B'
$objPHPExcel->getProperties()->getTitle() . '&RPage &P of &N';
Substitution and format codes (starting from y) can be used within headers and footers
of the page. There is no necessary order in which these codes must appear.
The first appearance of the following codes converts the ON format, the second appearance
turn OFF again:
• Strikethrough
• Superscript
• Subscript
&L Code of the 'left section' (there are three headers and
footer locations, the "left", "center", and "right".
When two or more occurrences of this section marker exist, the
the content of all the markers is concatenated, in the order of
appearance, and is placed on the left side.
&P Current page code #
&N Total pages code
&font size Code for "the font size of text", where the size of the
source is a font size in points.
&K Text font color code
$objDrawing = new
PHPExcel_Worksheet_HeaderFooterDrawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif');
$objDrawing->setHeight(36);
$objPHPExcel->getActiveSheet()->getHeaderFooter()-
>addImage($objDrawing,
PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT
&U Code for 'underlined text only'
&E Code of the 'double underline'
&R Code of the "right section". When two or more appearances of
this section marker exists, the content of all
markers are concatenated, in the order of appearance, and are placed in the
right section.
&Z Code for "the file path of this book"
&F Code for "filename of this book"
&A Code of the 'sheet name tag'
&+ Code to add to the page #
&- Code to subtract from the page #
Tip
The table above the codes may seem overwhelming the first time you are trying to find the
Manner of writing some header or footer. Fortunately, there is an easier way.
Microsoft Office Excel does the work for you.
For example, create an xlsx file in Microsoft Office Excel where the header and footer are inserted.
From the page as you wish using the programs in the interface itself. Save file as [Link].
Save file as [Link]. Now, take that file and read off the values using PHPExcel as
Now, take the file and read the values using PHPExcel as follows:
$objPHPexcel = PHPExcel_IOFactory::load('[Link]');
$objWorksheet = $objPHPexcel->getActiveSheet();
var_dump($objWorksheet->getHeaderFooter()->getOddFooter());
var_dump($objWorksheet->getHeaderFooter()->getEvenFooter());
var_dump($objWorksheet->getHeaderFooter()->getOddHeader());
var_dump($objWorksheet->getHeaderFooter()->getEvenHeader());
It reveals the codes for even/odd header and footer. Experienced users can
find it easier to rename [Link] to [Link], decompress it, and inspect
directly the content of the relevant sheets / [Link] to find the codes of
header and footer.
$objPHPExcel->getActiveSheet()->setBreak('A10', PHPExcel_Worksheet::BREAK_ROW);
$objPHPExcel->getActiveSheet()->setBreak('D10',
PHPExcel_Worksheet::BREAK_COLUMN );
$objPHPExcel->getActiveSheet()->setShowGridlines(true);
$objPHPExcel->getActiveSheet()->getPageSetup()-
setRowsToRepeatAtTopByStartAndEnd(1, 5);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5');
$objPHPExcel->getActiveSheet()->getPageSetup()->setPrintArea('A1:E5,G4:M20');
The provided text appears to be a fragment of code and does not require translation.
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);
The provided text appears to be a code snippet rather than a translatable text.
setARGB('FFFF0000');
Starting from PHPExcel 1.7.0, getStyle() also accepts a range of cells as a parameter.
for example, you can set a red background in a range of cells:
$objPHPExcel->getActiveSheet()->getStyle('B3:B7')->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)
->getStartColor()->setARGB('FFFF0000');
Tip
It is recommended to set the style of the cells at once, using getStyle for example ('A1: M500), instead
to cultivate the cells individually in a loop. This is much faster in comparison
with a loop through the cells and the style individually.
array(
array
'bold' => true,
),
'alignment' => array(
PHPExcel_Style_Alignment::HORIZONTAL_RIGHT
),
array
array
PHPExcel_Style_Border::BORDER_THIN
),
),
array
PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR
'rotation' => 90,
'startcolor' => array(
FFA0A0A0
),
'endcolor' => array(
FFFFFFFF
),
),
);
$objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getStyle('B3:B7')->applyFromArray($styleArray);
This alternative method using matrices should be faster in terms of execution every time.
it's going to configure more than one style property. But the difference can hardly be measured.
less than there are different styles in the book.
In Microsoft Office Excel, those who are familiar with selecting a number format of
"Cell Format" dialog. Here are some available predefined number formats.
including some of the dates. The dialogue is designed in such a way that you do not have
to interact with the underlying code number in raw format unless needed a
custom number format.
In PHPExcel, you can also apply various predefined number formats. Example:
$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1);
You can get exactly the same thing as the above by using this:
$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
->setFormatCode('#,##0.00');
In Microsoft Office Excel, as well as in PHPExcel, you will need to interact with the RAW format
numerical codes whenever you need some special number format. Example:
$objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
->setFormatCode('[Blue][>=3000]$#,##0;[Red][<0]$#,##0;$#,##0');
Another example is when it is desired that the numbers zero are filled with zeros on the left with a
fixed length:
$objPHPExcel->getActiveSheet()->getCell('A1')->setValue(19);
$objPHPExcel->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 quite
complicated. Sometimes, you know how to create a number format in Microsoft Office Excel, but
They don't know what the code number of the underlying format looks like. How did you find it?
Readers send with PHPExcel come to the rescue. Upload your workbook template using, for example
Excel 2007 reader to reveal the number format code. Example of how to read a code of
Number format for cell A1:
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load('[Link]');
var_dump($objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
->getFormatCode());
$objPHPExcel->getActiveSheet()->getStyle('A1:D4')
->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
$objPHPExcel->getActiveSheet()->getStyle('A1:D4')
->getAlignment()->setWrapText(true);
$objPHPExcel->getDefaultStyle()->getFont()->setName('Arial');
$objPHPExcel->getDefaultStyle()->getFont()->setSize(8);
array(
'borders' => array(
'outline' => array(
PHPExcel_Style_Border::BORDER_THICK
'color' => array('argb' => 'FFFF0000'),
),
),
);
$objWorksheet->getStyle('B2:G8')->applyFromArray($styleArray);
In Microsoft Office Excel, the previous operation would correspond to selecting the cells B2:
from the G-8, the launch of the style dialog, the choice of a thick red border, and
click on the diagram 'border component'.
Please note that the border lines apply to the rectangular selection B2: of the G-8 in
as a whole, not in each individual cell.
You can achieve any border effect by using only the five basic borders and
operating in a single cell at one moment:
shortcut to the additional borders very useful, as in the example above the.
These are the available shortcut borders:
If at the same time we set all borders, for example, and vertical, then we have
superposition of the borders, and one of the components has to prevail over the other, where not
borders overlap. In PHPExcel, from weakest to strongest of the borders, the list is
the following: all borders, contour / interior, vertical and horizontal, left / right / top /
down / diagonal.
This hierarchy of the border can be used to achieve different effects in a way
easy.
A set of conditional styling rules can be established for a cell using the following
code:
$conditionalStyles = $objPHPExcel->getActiveSheet()->getStyle('B2')
getConditionalStyles();
array_push($conditionalStyles, $objConditional1);
array_push($conditionalStyles, $objConditional2);
If you want to copy the set of rules to other cells, you can duplicate the style object:
$objPHPExcel->getActiveSheet()->duplicateStyle( $objPHPExcel->getActiveSheet()-
>getStyle('B2'), 'B3:B7' );
$objPHPExcel->getActiveSheet()->getComment('E11')->setAuthor('PHPExcel');
$objCommentRichText = $objPHPExcel->getActiveSheet()->getComment('E11')->getText()-
PHPExcel:
$objCommentRichText->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getComment('E11')->getText()-
translatedText
Total
amount on the current invoice, excluding VAT.
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:C9');
Excel offers 3 levels of 'protection': document security, sheet security and the
cell security.
$objPHPExcel->getSecurity()->setLockWindows(true);
$objPHPExcel->getSecurity()->setLockStructure(true);
$objPHPExcel->getSecurity()->setWorkbookPassword("PHPExcel");
$objPHPExcel->getActiveSheet()->getProtection()->setPassword('PHPExcel');
$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
$objPHPExcel->getActiveSheet()->getProtection()->setSort(true);
$objPHPExcel->getActiveSheet()->getProtection()->setInsertRows(true);
$objPHPExcel->getActiveSheet()->getProtection()->setFormatCells(true);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(
PHPExcel_Style_Protection::PROTECTION_UNPROTECTED
);
This can be done using the following code $ objPHPExcel-> getActiveSheet () ->
getProtection () -> setSheet (true)
The following code snippet only allows a number between 10 and 20 that is entered in cell B3:
$objValidation = $objPHPExcel->getActiveSheet()->getCell('B3')
->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_WHOLE );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP );
$objValidation->setAllowBlank(true);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
Input error
Number is not allowed!
Allowed input
Only numbers between 10 and 20 are allowed.
$objValidation->setFormula1(10);
$objValidation->setFormula2(20);
The following code snippet only allows one selected element from a data list that
should appear in cell B3:
$objValidation = $objPHPExcel->getActiveSheet()->getCell('B5')
->getDataValidation();
When using a data validation list like the above, make sure to put the
list between "and" that separates the elements with a comma (,) .
It is important to remember that any string that participates in an Excel formula is
allows a maximum of 255 characters (not bytes). This sets a limit on the number of
elements that can be in the string "Point A, Point B, Point C". Therefore, normally
it is a better idea to write the article directly in the values in some range of cells, for
example A1: A3, and instead of using, for example, $ objValidation-> setFormula1 ('Sheet 3! $ A
$ 1: $ A $'. Another benefit is that the topic can contain the own values of the comma ','
character.
If you need data validation in multiple cells, you can clone the set of rules.
$objPHPExcel->getActiveSheet()->getCell('B8')->setDataValidation(clone
$objValidation);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(12);
If you want PHPExcel to perform an automatic width calculation, use the following code.
PHPExcel will approach the column with the width of the widest value column.
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);
3) total width in character units (for example, 9.140625, the value -1 indicates width of
disconnection)
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setVisible(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1);
You can also contract the column. Please note that you should also set the column.
invisible, otherwise the drop will not be visible in Excel 2007.
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setCollapsed(true);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setVisible(false);
Please refer to the part 'group / outline a row' of a complete example in the collapse.
You can indicate PHPExcel to add a summary to the right (by default), or to the
leftThe following code adds the summary to the left:
$objPHPExcel->getActiveSheet()->setShowSummaryRight(false);
$objPHPExcel->getActiveSheet()->getRowDimension('10')->setRowHeight(100);
$objPHPExcel->getActiveSheet()->getRowDimension('10')->setVisible(false);
$objPHPExcel->getActiveSheet()->getRowDimension('5')->setOutlineLevel(1);
You can also collapse the row. Note that you must also set the invisible line.
the opposite the drop will not be visible in Excel 2007.
$objPHPExcel->getActiveSheet()->getRowDimension('5')->setCollapsed(true);
$objPHPExcel->getActiveSheet()->getRowDimension('5')->setVisible(false);
$objPHPExcel->getActiveSheet()->getRowDimension($i)->setOutlineLevel(1);
$objPHPExcel->getActiveSheet()->getRowDimension($i)->setVisible(false);
}
$objPHPExcel->getActiveSheet()->getRowDimension(81)->setCollapsed(true);
You can indicate PHPExcel to add a summary of the collapsible rows (by default) next.
the superior. The following code adds the previous summary:
$objPHPExcel->getActiveSheet()->setShowSummaryBelow(false);
$objPHPExcel->getActiveSheet()->mergeCells('A18:E22');
$objPHPExcel->getActiveSheet()->unmergeCells('A18:E22');
$objPHPExcel->getActiveSheet()->insertNewRowBefore(7, 2);
To add the logo to the spreadsheet, use the following code snippet. PHPExcel
create the link between the drawing and the spreadsheet:
$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
You can set the properties of numerous in a drawing, here are some examples:
$objDrawing->setName('Paid');
$objDrawing->setDescription('Paid');
$objDrawing->setPath('./images/[Link]');
$objDrawing->setCoordinates('B15');
$objDrawing->setOffsetX(110);
$objDrawing->setRotation(25);
$objDrawing->getShadow()->setVisible(true);
$objDrawing->getShadow()->setDirection(45);
This invoice is payable within thirty days following the end of the month unless otherwise stated.
specify the opposite on the invoice.
$objPHPExcel->getActiveSheet()->getCell('A18')->setValue($objRichText);
HTTP headers
Example of a script sequence to redirect an Excel 2007 file to the browser
client
<?php
/*Here there will be some code where objPHPExcel is created */
<?php
/*Here there will be some code where objPHPExcel is created */
• Make sure not to include any echo of statements or the output of anyone else
content that the Excel file. There should be no blank spaces before the opening <?
PHP tags and more on a new line after the closing ?> Tags (which also
it can be omitted to avoid problems.
• Make sure the script is saved without a bill of materials (mark of
byte order). (Since this counts as echo of the output)
• the same applies to all included files
Not following these rules can result in corrupted Excel files reaching the browser of
client, and/or that the headers cannot be set by PHP (which results in messages of
warning).
$objPHPExcel->getActiveSheet()->getDefaultColumnDimension()->setWidth(12);
$objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(15);
Here is an example that generates an image in memory and adds it to the active spreadsheet:
Generate an image
$objPHPExcel->getActiveSheet()->getSheetView()->setZoomScale(75);
$objWorksheet->getTabColor()->setRGB('FF0000');
$objWorksheet1 = $objPHPExcel->createSheet();
$objWorksheet1->setTitle('Another sheet');
Think of createSheet() as the 'Insert sheet button in Excel. When you press the button of a
A new sheet is added to the existing collection of the book's sheets.
$objPHPExcel->getActiveSheet()
->setSheetState(PHPExcel_Worksheet::SHEETSTATE_HIDDEN);
It is possible that you want the spreadsheet to be 'very hidden'. The sheet of states
available are:
PHPExcel_Worksheet::SHEETSTATE_VISIBLE
PHPExcel_Worksheet::SHEETSTATE_HIDDEN
PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN
In the Excel sheet state 'very hidden', it can only be set programmatically, due to
example, with Visual Basic Macro. It is not possible to make a sheet visible through the interface of
user.
For the calculation of a formula, you can refer to the cell that contains the formula of the method of the
getCalculatedValue(), for example:
$objPHPExcel->getActiveSheet()->getCell('E11')->getCalculatedValue();
If you write the following line of code in the demo invoice included with PHPExcel, it is evaluated
like the value '64':
Another interesting feature of the PHPExcel parser formula is that it can be adjusted.
automatically a formula to insert / delete rows / columns. Here is an example:
You see that the formula contained in cell E11 is "SUM(E4:E9)". Now, when I write the
the following line of code, two new product lines are added:
$objPHPExcel->getActiveSheet()->insertNewRowBefore(7, 2);
In Excel, '+' beats '&', just as '*' slightly beats '+' in ordinary algebra. The rule
previous is not what is found using the calculation engine included with PHPExcel.
[Link] [Link]
[Link]
6.1. PHPExcel_IOFactory
• Direct creation of
• Through PHPExcel_IOFactory
All the examples below demonstrate the method of direct creation. Note that
You can also use the PHPExcel_IOFactory class to do this.
There are two methods for reading a file in PHPExcel: using automatic file type detection.
solve it explicitly.
$objPHPExcel = PHPExcel_IOFactory::load("[Link]");
A typical use of this function is when it is needed to read the files uploaded by users, and
I don't know if it's loading xls or xlsx.
If it is necessary to set some properties on the reader (for example, to read only the data,
see more about this later), then instead of wanting to use this variant:
$objReader = PHPExcel_IOFactory::createReaderForFile("[Link]");
$objReader->setReadDataOnly(true);
$objReader->load("[Link]");
$objReader = PHPExcel_IOFactory::createReader("Excel2007");
$objPHPExcel = $objReader->load("[Link]");
6.2.1. PHPExcel_Reader_Excel2007
Reading a spreadsheet
read-only data
You can set the setReadDataOnly option on the reader to instruct the reader to bypass the
style, data validation, ... and just read data from the cell:
You can configure the setLoadSheetsOnly option in the reader to instruct the reader to load only
the leaves with a name that is given:
You can set the setReadFilter option on the reader, to instruct the reader to load only the
cells that match a given rule. A reading of the filter can be any class that
implement PHPExcel_Reader_IReadFilter. By default, all cells are read using the
PHPExcel_Reader_DefaultReadFilter.
The following code will only read row 1 and rows 20 to 30 from any sheet in the Excel file:
return false;
}
}
Formula pre-calculation
By default, this writer pre-calculates all the formulas in the spreadsheet. This
it can be slow on large spreadsheets, and perhaps even unwanted. You can disable the
formula however before calculation:
Due to a bug in the Office2003 compatibility pack, there may be some small
problems when opening Excel 2007 spreadsheets (mostly related to calculation of the
formula). It can enable Office 2003 compatibility with the following code:
Please note that files in BIFF format have some limitations regarding cells.
style and handling of large spreadsheets through PHP.
read-only data
You can set the setReadDataOnly option in the reader to instruct the reader to skip the
style, data validation, ... and has just read data from the cell:
You can set the setLoadSheetsOnly option in the reader, to instruct the reader to load only
the leaves with a name that is given:
You can set the setReadFilter option in the reader to instruct the reader to load only the
cells that match a given rule. A filter read can be any class that
implement PHPExcel_Reader_IReadFilter. By default, all cells are read using the
PHPExcel_Reader_DefaultReadFilter.
The following code will only read row 1 and rows 20 to 30 from any sheet in the Excel file:
return false;
}
6.3.2. PHPExcel_Writer_Excel5
Write a spreadsheet
6.4.1. PHPExcel_Reader_Excel2003XML
Reading a spreadsheet
You can read the XML code. File with the following:
You can set the setReadFilter option in the reader, to instruct the reader to load only the
cells that match a given rule. A filter reading can be any class that
implement PHPExcel_Reader_IReadFilter. By default, all cells are read using the
PHPExcel_Reader_DefaultReadFilter.
The following code will only read row 1 and rows 20 to 30 of any sheet in the Excel file:
return false;
}
SYLK limitations
Please note that SYLK format files have some limitations regarding the cells of
style and management of large spreadsheets through PHP.
You can set the setReadFilter option in the reader to instruct the reader to load only the
cells that match a given rule. A filter reading can be any class that
implement PHPExcel_Reader_IReadFilter. By default, all cells are read using the
PHPExcel_Reader_DefaultReadFilter.
The following code will only read row 1 and rows 20 to 30 of any sheet in the SYLK file:
return false;
}
}
6.6.1. PHPExcel_Reader_CSV
Reading a CSV file
Often, CSV files are not actually 'comma-separated', or semicolon used (;)
separator. PHPExcel_Reader_CSV can indicate some options before reading a CSV file.
Please note that PHPExcel_Reader_CSV by default assumes that the loading of the CSV file is
UTF-8 encoding. If you are reading CSV files that were created in Microsoft Office Excel
the correct input encoding and cannot be Windows-1252 (CP1252). Always ensure to
that the encoding of an appropriate value.
CSV files can only contain one spreadsheet. Therefore, you can specify that the sheet
to read from CSV:
$objReader->setSheetIndex(0);
When working with CSV files, it may happen that you want to import CSV data into an object.
existing PHPExcel. The following code loads a CSV file in current dollars objPHPExcel
it contains some sheets, and the imports in sheet 6º:
Often, CSV files are not really "comma-separated" or use a semicolon (;) as
separator. PHPExcel_Writer_CSV can indicate some options before writing a CSV file:
CSV files can only contain one spreadsheet. Therefore, you can specify which sheet to
write to a CSV file:
$objWriter->setSheetIndex(0);
Pre-calculus formula
By default, this writer pre-calculates all the formulas in the spreadsheet. This
it can be slow on large spreadsheets, and perhaps even unwanted. You can disable the
formula however before calculation:
A CSV file can be marked as UTF-8 by writing a header in the list file.
materials. This can be activated using the following code:
If the spreadsheet you are exporting contains numbers with thousands or decimal separators,
then you should think about the characters you want to use for those before proceeding to do the
export
require_once 'PHPExcel/Shared/[Link]'
PHPExcel_Shared_String::setDecimalSeparator('.');
PHPExcel_Shared_String::setThousandsSeparator(',');
require_once 'PHPExcel/Shared/[Link]'
PHPExcel_Shared_String::setDecimalSeparator(',');
PHPExcel_Shared_String::setThousandsSeparator('.');
Please note that the above code sets and thousand decimal separators as options.
global. This also affects the way it is exported in HTML and PDF.
6.7. HTML
PHPExcel allows you to write a spreadsheet in HTML format for quick representation.
the data in it to anyone who does not have a spreadsheet on their PC.
HTML limitations
Please note that an HTML file has certain limitations regarding cells.
style, number format, ...
6.7.1. PHPExcel_HTML_Writer
Write a spreadsheet
HTML files can contain one or more spreadsheets. If you want to write all the sheets in
a single HTML file, use the following code:
$objWriter->writeAllSheets();
HTML files can contain one or more spreadsheets. Therefore, you can specify what
writing sheet in HTML:
$objWriter->setSheetIndex(0);
There may be situations where you want to explicitly include the root images.
For example, one might want to see the style <img = "position: relative; left:
0px; top: 0px; width: 140px; height: 78px;" src = "images
[Link] logo . jpg "border =" 0 "> instead of style
$objWriter->setImagesRoot('[Link]
Pre-calculation formula
There could be a situation where you want to embed the generated HTML code on a website.
existing. PHPExcel_Writer_HTML provides support for generating only the specific parts of
HTML code that allows the use of these pieces on your website.
Supported methods:
• generateHTMLHeader()
• generateStyles()
• generateSheetData()
• generateHTMLFooter()
Here is an example that retrieves all the parts independently and combines them into one.
resulting HTML page:
<?php
$objWriter = new PHPExcel_Writer_HTML($objPHPExcel);
echo $objWriter->generateHTMLHeader();
?>
<style>
<!--
html {
font-family: Times New Roman;
font-size: 9pt;
background-color: white;
}
<?php
echo $objWriter->generateStyles(false); // do not write <style> and </style>
?>
-->
<?php
echo $objWriter->generateSheetData();
echo $objWriter->generateHTMLFooter();
?>
An HTML file can be marked as UTF-8 by writing a header at the beginning of the file.
materials. This can be activated using the following code:
6.8. PDF
PHPExcel allows you to write a spreadsheet in PDF format, for quick distribution of the
represented data.
PDF limitations
Please note that PDF files have some limitations regarding cells.
of style, number format, ...
6.8.1. PHPExcel_Writer_PDF
Write a spreadsheet
PDF files can contain one or more spreadsheets. If you want to write all the sheets in
a single PDF file, use the following code:
$objWriter->writeAllSheets();
PDF files can contain one or more spreadsheets. Therefore, you can specify what
sheet for writing in PDF:
$objWriter->setSheetIndex(0);
Formula pre-calculation
By default, this writer pre-calculates all the formulas in the spreadsheet. This
it can be slow in large spreadsheets, and perhaps undesirable, it can even disable the
formula however before calculation:
Here is an example of how to open a template file, fill in a couple of fields, and save it.
new
$objPHPexcel = PHPExcel_IOFactory::load('[Link]');
$objWorksheet = $objPHPexcel->getActiveSheet();
John
$objWorksheet->getCell('A2')->setValue('Smith');
Please note that an xlsx file can be uploaded and an xls file generated.
4. Credits
Please refer to the internet pageThe provided text is a URL and does not contain translatable content.
Creditsfor up-to-date credits. Please check the website
[Link]
update the credit date.
PHPExcel_Style
Array key: Maps to property:
fill getFill()
font getFont()
borders getBorders()
alignment getAlignment()
number format getNumberFormat()
protection getProtection()
PHPExcel_Style_Fill
Array key: Maps to property:
type setFillType()
rotation setRotation()
startcolor getStartColor()
endcolor getEndColor()
color getStartColor()
PHPExcel_Style_Font
Array key: Maps to property:
name setName()
bold setBold()
italic setItalic()
underline setUnderline()
strike setStrikethrough()
color getColor()
size setSize()
superScript setSuperScript()
subScript setSubScript()
PHPExcel_Style_Border
Array key: Maps to property:
style setBorderStyle()
color getColor()
PHPExcel_Style_NumberFormat
Array key Maps to property:
code setFormatCode()
PHPExcel_Style_Protection
Array key: Maps to property:
locked setLocked()
hidden setHidden()