Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Formula pre-calculation

By default, this writer pre-calculates all formulas in the spreadsheet. This can be slow on large spreadsheets, and maybe even unwanted. You can however disable formula pre-calculation:

$objWriter = new PHPExcel_Writer_PDF($objPHPExcel);
$objWriter->setPreCalculateFormulas(false);

$objWriter->save("05featuredemo.pdf");

Decimal and thousands separators

See section PHPExcel_Writer_CSV how to control the appearance of these.

 

Generating Excel files from templates (read, modify, write)

Readers and writers are the tools that allow you to generate Excel files from templates. This requires less coding effort than generating the Excel file from scratch, especially if your template has many styles, page setup properties, headers etc.

 

Here is an example how to open a template file, fill in a couple of fields and save it again:

$objPHPexcel = PHPExcel_IOFactory::load('template.xlsx');

 

$objWorksheet = $objPHPexcel->getActiveSheet();

$objWorksheet->getCell('A1')->setValue('John');

$objWorksheet->getCell('A2')->setValue('Smith');

 

$objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel, 'Excel5');

$objWriter->save('write.xls');

 

Notice that it is ok to load an xlsx file and generate an xls file.

Credits

Please refer to the internet page http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=Credits&referringTitle=Home for up-to-date credits.

Appendix A: Valid array keys for style applyFromArray()

The following table lists the valid array keys for PHPExcel_Style applyFromArray() classes. If the “Maps to property” column maps a key to a setter, the value provided for that key will be applied directly. If the “Maps to property” column maps a key to a getter, the value provided for that key will be applied as another style array.

 

PHPExcel_Style
Array key: Maps to property:
fill font borders alignment numberformat protection getFill() getFont() getBorders() getAlignment() getNumberFormat() getProtection()
PHPExcel_Style_Fill
Array key: Maps to property:
type rotation startcolor endcolor color setFillType() setRotation() getStartColor() getEndColor() getStartColor()
PHPExcel_Style_Font
Array key: Maps to property:
name bold italic underline strike color size superScript subScript setName() setBold() setItalic() setUnderline() setStrikethrough() getColor() setSize() setSuperScript() setSubScript()
PHPExcel_Style_Borders
Array key: Maps to property:
allborders left right top bottom diagonal vertical horizontal diagonaldirection outline getLeft(); getRight(); getTop(); getBottom() getLeft() getRight() getTop() getBottom() getDiagonal() getVertical() getHorizontal() setDiagonalDirection() setOutline()
PHPExcel_Style_Border
Array key: Maps to property:
style color setBorderStyle() getColor()
PHPExcel_Style_Alignment
Array key: Maps to property:
horizontal vertical rotation wrap shrinkToFit indent setHorizontal() setVertical() setTextRotation() setWrapText() setShrinkToFit() setIndent()
PHPExcel_Style_NumberFormat
Array key: Maps to property:
code setFormatCode()
PHPExcel_Style_Protection
Array key: Maps to property:
locked hidden setLocked() setHidden()

 




[1] You must have APC enabled for PHP to use this option.

[2] You must have a memcache server running, and have enabled memcache for your PHP to use this option.

[3] You must have Wincache enabled for PHP to use this option.


Date: 2016-03-03; view: 786


<== previous page | next page ==>
Setting the images root of the HTML file | America Politica Historia, In Spontaneity
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.006 sec.)