+ All Categories
Home > Documents > PHPExcel Developer Doc

PHPExcel Developer Doc

Date post: 04-Jun-2018
Category:
Upload: edelmann-gutierrez
View: 239 times
Download: 0 times
Share this document with a friend

of 46

Transcript
  • 8/13/2019 PHPExcel Developer Doc

    1/46

    PHPExcel Developer Documentation

    Author: Maarten BalliauwVersion: 1.7.4Date: 26 februari 2011

  • 8/13/2019 PHPExcel Developer Doc

    2/46

    1. Contents PHPExcel Developer Documentation............................................................................11. ontent!..........................................................................................................22. Prere"ui!ite!.....................................................................................................#

    #. $rc%itecture.....................................................................................................64. reatin& a !prea'!%eet......................................................................................... (). Performin& formula calculation!............................................................................##6. *ea'in& an' writin& to file...................................................................................#)7. re'it!...........................................................................................................44$ppen'ix $+ ,ali' arra- e-! for !t-le appl-/rom$rra-...................................................4)

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    3/46

    2. Prerequisites

    2.1. Software requirements%e followin& !oftware i! re"uire' to 'evelop u!in& PHPExcel+

    3 PHP ver!ion ).2.0 or newer3 PHP exten!ion p%p5ip enable' 3 PHP exten!ion p%pxml enable'3 PHP exten!ion p%p&'2 enable' if not compile' in

    *) php_zipi! onl- nee'e' b- PHPExcel_Reader_Excel2007 PHPExcel_riter_Excel2007 an'PHPExcel_Reader_!!"alc . 8n ot%er wor'! if -ou nee' PHPExcel to %an'le .xl!x or .o'! file! -ou will nee't%e 5ip exten!ion but ot%erwi!e not.9ou can remove t%i! 'epen'enc- for writin& Excel2007 file! not for rea'in& b- u!in& t%e P:;ip librar- t%ati! bun'le' wit% PHPExcel.

  • 8/13/2019 PHPExcel Developer Doc

    4/46

    c6bb74c'1466F'i!pla-lan&en

    3 !pen&'( Pac+a/e Explorer%ttp+??www.co'eplex.com?Paca&eExplorer?

    2.4.2. #requentl$ as%e! questions

    %e upto'ate /.$.=. pa&e for PHPExcel can be foun' on%ttp+??www.co'eplex.com?PHPExcel?Gii?,iew.a!pxCtitle/$=Freferrin&itle*e"uirement!.

    &"ere seems to 'e a pro'lem (it" c"aracter enco!in)...

    8t i! nece!!ar- to u!e / enco'in& for all text! in PHPExcel. 8f t%e !cript u!e! 'ifferent enco'in&t%en it i! po!!ible to convert t%e text! wit% PHPI! iconv function.

    PHP complains a'out *ip+rc"ive not 'ein) ,oun!

    Mae !ure -ou meet all re"uirement! e!peciall- p%p5ip exten!ion !%oul' be enable'.

    %e ;ip$rc%ive cla!! i! onl- re"uire' w%en rea'in& or writin& format! t%at u!e ;ip compre!!ionExcel2007 an' JJalc.

  • 8/13/2019 PHPExcel Developer Doc

    5/46

    Protection on m$ (or%s"eet is not (or%in)5

    G%en -ou mae u!e of an- of t%e wor!%eet protection feature! e.&. cell ran&e protectionpro%ibitin& 'eletin& row! ... mae !ure -ou enable wor!%eet !ecurit-. %i! can for example be'one lie t%i!+

    $objPHPExcel!getActi"eS#eet()!getPotection()!setS#eet(t%e);

    #eature X is not (or%in) (it" PHPExcel6ea!er7 / PHPExcel0riter*

    Aot all feature! of PHPExcel are implemente' in all of t%e *ea'er ? Griter cla!!e!. %i! i! mo!tl-'ue to un'erl-in& librarie! not !upportin& a !pecific feature or not %avin& implemente' a !pecificfeature.

    /or example autofilter i! not implemente' in PE$*

  • 8/13/2019 PHPExcel Developer Doc

    6/46

    9. +rc"itecture

    3.1. Schematical

    3.2. Laz Loader PHPExcel implement! an autoloa'er or Kla5- loa'erL w%ic% mean! t%at it i! not nece!!ar- toinclu'e ever- file wit%in PHPExcel. 8t i! onl- nece!!ar- to inclu'e t%e initial PHPExcel cla!! filet%en t%e autoloa'er will inclu'e ot%er cla!! file! a! an' w%en re"uire' !o onl- t%o!e file! t%at areactuall- re"uire' b- -our !cript will be loa'e' into PHP memor-. %e main benefit of t%i! i! t%at itre'uce! t%e memor- footprint of PHPExcel it!elf !o t%at it u!e! le!! PHP memor-.

    8f -our own !cript! alrea'- 'efine an autoloa' function t%en t%i! ma- be overwritten b- t%ePHPExcel autoloa' function. /or example if -ou %ave+

    &%nction __a%toloa($class) ***+

    Do t%i! in!tea'+

    &%nction ,-A%toloa($class) ***+spl_a%toloa_egiste(.,-A%toloa.);

    9our autoloa'er will t%en coexi!t wit% t%e autoloa'er of PHPExcel.

    3.3. S!readsheet in memorPHPExcel>! arc%itecture i! built in a wa- t%at it can !erve a! an inmemor- !prea'!%eet. %i! mean!t%at if one woul' want to create a web ba!e' view of a !prea'!%eet w%ic% communicate! wit%PHPExcel>! obYect mo'el %e woul' onl- %ave to write t%e fronten' co'e.

    u!t lie 'e!top !prea'!%eet !oftware PHPExcel repre!ent! a !prea'!%eet containin& one or morewor!%eet! w%ic% contain cell! wit% 'ata formula! ima&e! Z

    3.4. "eaders and writers

    Jn it! own PHPExcel 'oe! not provi'e t%e functionalit- to rea' from or write to a per!i!te'!prea'!%eet on 'i! or in a 'ataba!e. o provi'e t%at functionalit- rea'er! an' writer! can beu!e'.

    PHPExcel Developer Documentation 6

  • 8/13/2019 PHPExcel Developer Doc

    7/46

    B- 'efault t%e PHPExcel paca&e provi'e! !ome rea'er! an' writer! inclu'in& one for t%e Jpen[M: !prea'!%eet format a..a. Excel 2007 file format. 9ou are not limite' to t%e 'efault rea'er!an' writer! a! -ou are free to implement t%e PHPExcelGriter8*ea'er an'PHPExcelGriter8Griter interface in a cu!tom cla!!.

    3.#. $luent interfacesPHPExcel !upport! fluent interface! in mo!t location!. %i! mean! t%at -ou can ea!il- Kc%ainL call!to !pecific met%o'! wit%out re"uirin& a new PHP !tatement. /or example tae t%e followin& co'e+

    $objPHPExcel!getPopeties()!setCeato(/0aaten 1allia%2/);

    PHPExcel Developer Documentation 7

  • 8/13/2019 PHPExcel Developer Doc

    8/46

    $objPHPExcel!getPopeties()!setLast0oi&ie1-(/0aaten 1allia%2/);$objPHPExcel!getPopeties()!set3itle(/4&&ice 5667 8LS8 3est 9oc%,ent/);$objPHPExcel!getPopeties()!setS%bject(/4&&ice 5667 8LS8 3est 9oc%,ent/);$objPHPExcel!getPopeties()!set9esciption(/3est oc%,ent &o 4&&ice 5667 8LS8geneate %sing PHP classes*/);$objPHPExcel!getPopeties()!sete-2os(/o&&ice 5667 openx,l p#p/);$objPHPExcel!getPopeties()!setCatego-(/3est es%lt &ile/);

    %i! can be rewritten a!+

    $objPHPExcel!getPopeties() !setCeato(/0aaten 1allia%2/) !setLast0oi&ie1-(/0aaten 1allia%2/) !set3itle(/4&&ice 5667 8LS8 3est 9oc%,ent/) !setS%bject(/4&&ice 5667 8LS8 3est 9oc%,ent/) !set9esciption(/3est oc%,ent &o 4&&ice 5667 8LS8 geneate %singPHP classes*/) !sete-2os(/o&&ice 5667 openx,l p#p/) !setCatego-(/3est es%lt &ile/);

    sin/ $luent inter$aces is not re3uired/luent interface! %ave been implemente' to provi'e a convenient pro&rammin& $P8. !e of t%em i! notre"uire' but can mae -our co'e ea!ier to rea' an' maintain.

    PHPExcel Developer Documentation

  • 8/13/2019 PHPExcel Developer Doc

    9/46

    4. Creatin) a sprea!s"eet

    4.1. %he &'&()cel class%e PHPExcel cla!! i! t%e core of PHPExcel. 8t contain! reference! to t%e containe' wor!%eet!

    'ocument !ecurit- !ettin&! an' 'ocument meta 'ata.

    o !implif- t%e PHPExcel concept+ t%e PHPExcel cla!! repre!ent! -our worboo.

    4.2. *onfiguration SettingsJnce -ou %ave inclu'e' t%e PHPExcel file! in -our !cript but before in!tantiatin& a PHPExcel obYector loa'in& a worboo file t%ere are a number of confi&uration option! t%at can be !et w%ic% willaffect t%e !ub!e"uent be%aviour of t%e !cript.

    4.2.1. Cell Cac"in)PHPExcel u!e! an avera&e of about 1?cell in -our wor!%eet! !o lar&e worboo! can "uicl- u!e

    up available memor-. ell cac%in& provi'e! a mec%ani!m t%at allow! PHPExcel to maintain t%e cellobYect! in a !maller !i5e of memor- on 'i! or in $P memcac%e or Gincac%e rat%er t%an in PHPmemor-. %i! allow! -ou to re'uce t%e memor- u!a&e for lar&e worboo! alt%ou&% at a co!t of!pee' to acce!! cell 'ata.B- 'efault PHPExcel !till %ol'! all cell obYect! in memor- but -ou can !pecif- alternative!. oenable cell cac%in& -ou mu!t call t%e PHPExcel

  • 8/13/2019 PHPExcel Developer Doc

    10/46

    PHPExcelac%e'JbYecte .

    %e p%p+??temp file i! automaticall- 'elete' w%en -our !cript terminate!.

    PHPExcelac%e'JbYectG%en -our !cript terminate! all entrie! will be cleare' from $P re&ar'le!! of t%e cac%eime value!o it cannot be u!e' for per!i!tent !tora&e u!in& t%i! mec%ani!m.

    PHPExcelac%e'JbYect

  • 8/13/2019 PHPExcel Developer Doc

    11/46

    4.2.2. Lan)ua)e/Locale! value can be rea' a&ain u!in& t%e followin& line of co'e+$objPHPExcel!getActi"eS#eet()!getCell(.1?.)!getVal%e();

    8f -ou nee' t%e calculate' value of a cell u!e t%e followin& co'e. %i! i! furt%er explaine' in4.6.40.$objPHPExcel!getActi"eS#eet()!getCell(.1?.)!getCalc%lateVal%e();

    4.=.9. ettin) a cell value '$ column an! ro(!

    setCellVal%e1-Col%,nAnRo2 met%o'.

    PHPExcel Developer Documentation 1

  • 8/13/2019 PHPExcel Developer Doc

    12/46

    Set cell 1?$objPHPExcel!getActi"eS#eet()!setCellVal%e1-Col%,nAnRo2( ? .So,e "al%e.);

    4.=.4. 6etrievin) a cell '$ column an! ro(o retrieve t%e value of a cell t%e cell !%oul' fir!t be retrieve' from t%e wor!%eet u!in& t%e

    getCell1-Col%,nAnRo2 met%o'. $ cell>! value can be rea' a&ain u!in& t%e followin& line ofco'e+ et cell 1?$objPHPExcel!getActi"eS#eet()!getCell1-Col%,nAnRo2( ?)!getVal%e();

    8f -ou nee' t%e calculate' value of a cell u!e t%e followin& co'e. %i! i! furt%er explaine' in 4.6.40 et cell 1?$objPHPExcel!getActi"eS#eet()!getCell1-Col%,nAnRo2( ?)!getCalc%lateVal%e();

    4.=.=. Loopin) cells

    Loopin) cells usin) iterators

    %e ea!ie!t wa- to loop cell! i! b- u!in& iterator!. !in& iterator! one can u!e foreac% to loopwor!%eet! row! an' cell!.

    Below i! an example w%ere we rea' all t%e value! in a wor!%eet an' 'i!pla- t%em in a table.

    DJp#p$objReae < PHPExcel_I4=acto-::ceateReae(.Excel5667.);$objReae!setRea9ata4nl-(t%e);

    $objPHPExcel < $objReae!loa(/test*xlsx/);$objGos#eet < $objPHPExcel!getActi"eS#eet();

    ec#o .Dtable!. * /Fn/;&oeac# ($objGos#eet!getRo2Iteato() as $o2)

    ec#o .Dt!. * /Fn/;

    $cellIteato < $o2!getCellIteato(); $cellIteato!setIteate4nl-ExistingCells(&alse); 3#is loops all cells e"en i& it is not set* 1- e&a%lt onl- cells t#at ae set 2ill be iteate* &oeac# ($cellIteato as $cell) ec#o .Dt!. * $cell!getVal%e() * .Dt!. * /Fn/; +ec#o .Dt!. * /Fn/;

    +ec#o .Dtable!. * /Fn/;

    J!

    Aote t%at we %ave !et t%e cell iterator>! setIteate4nl-ExistingCells()to fal!e. %i! mae!t%e iterator loop all cell! even if t%e- were not !et before.

    4he cell iterator .ill return nullas the cell i$ it is not set in the .or+sheet5

    ! setIteate4nl-ExistingCells()to &alsewill loop all cell! in t%e wor!%eett%at can be available at t%at moment. %i! will create new cell! if re"uire' an' increa!e memor- u!a&e] Jnl-u!e it if it i! inten'e' to loop all cell! t%at are po!!ibl- available.

    Loopin) cells usin) in!exes

    Jne can u!e t%e po!!ibilit- to acce!! cell value! b- column an' row in'ex lie 01 in!tea' of I$1I

    for rea'in& an' writin& cell value! in loop!.

    PHPExcel Developer Documentation 1

  • 8/13/2019 PHPExcel Developer Doc

    13/46

    Aote+ 8n PHPExcel column in'ex i! 0ba!e' w%ile row in'ex i! 1ba!e'. %at mean! I$1I ^ 01

    Below i! an example w%ere we rea' all t%e value! in a wor!%eet an' 'i!pla- t%em in a table.

    DJp#p$objReae < PHPExcel_I4=acto-::ceateReae(.Excel5667.);

    $objReae!setRea9ata4nl-(t%e);

    $objPHPExcel < $objReae!loa(/test*xlsx/);$objGos#eet < $objPHPExcel!getActi"eS#eet();

    $#ig#estRo2 < $objGos#eet!getHig#estRo2(); e*g* 6$#ig#estCol%,n < $objGos#eet!getHig#estCol%,n(); e*g .=.

    $#ig#estCol%,nInex < PHPExcel_Cell::col%,nInex=o,Sting($#ig#estCol%,n); e*g*K

    ec#o .Dtable!. * /Fn/;&o ($o2 < ; $o2 D< $#ig#estRo2; $o2) ec#o .Dt!. * /Fn/;

    &o ($col < 6; $col D< $#ig#estCol%,nInex; $col) ec#o .Dt!. * $objGos#eet!getCell1-Col%,nAnRo2($col $o2)!getVal%e() *.Dt!. * /Fn/; +

    ec#o .Dt!. * /Fn/;+ec#o .Dtable!. * /Fn/;J!

    4.=.>. ?sin) value 'in!ers to ,acilitate !ata entr$8nternall- PHPExcel u!e! a 'efault PHPExcel_Cell_IVal%e1ine implementationPHPExcel_Cell_9e&a%ltVal%e1ine to 'etermine 'ata t-pe! of entere' 'ata u!in& a cell>!setVal%e()met%o'.

    Jptionall- t%e 'efault be%aviour of PHPExcel can be mo'ifie' allowin& ea!ier 'ata entr-. /orexample a PHPExcel_Cell_A"anceVal%e1ine cla!! i! pre!ent. 8t automaticall- convert!percenta&e! an' 'ate! entere' a! !trin&! to t%e correct format al!o !ettin& t%e cell>! !t-leinformation. %e followin& example 'emon!trate! %ow to !et t%e value bin'er in PHPExcel+

    MM PHPExcel MeN%ie_once .PHPExcel*p#p.;

    MM PHPExcel_Cell_A"anceVal%e1ine MeN%ie_once .PHPExcelCellA"anceVal%e1ine*p#p.;

    MM PHPExcel_I4=acto- MeN%ie_once .PHPExcelI4=acto-*p#p.;

    Set "al%e binePHPExcel_Cell::setVal%e1ine( ne2 PHPExcel_Cell_A"anceVal%e1ine() );

    Ceate ne2 PHPExcel object$objPHPExcel < ne2 PHPExcel();

    ***

    A so,e ata ese,bling so,e i&&eent ata t-pes$objPHPExcel!getActi"eS#eet()!setCellVal%e(.AO. .Pecentage "al%e:.);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.1O. .6.); Con"ets to 6* an sets pecentage cell st-le$objPHPExcel!getActi"eS#eet()!setCellVal%e(.AK. .9ateti,e "al%e:.);

    PHPExcel Developer Documentation 1

  • 8/13/2019 PHPExcel Developer Doc

    14/46

    $objPHPExcel!getActi"eS#eet()!setCellVal%e(.1K. .5 9ece,be Q?.); Con"ets to ate an sets ate &o,at cell st-le

    "reatin/ ,our o.n 6alue inder is eas,5G%en a'vance' value bin'in& i! re"uire' -ou can implement t%e PHPExcel_Cell_IVal%e1ineinterface or exten' t%e PHPExcel_Cell_9e&a%ltVal%e1ineor

    PHPExcel_Cell_A"anceVal%e1inecla!!e!.

    4.. &'&()cel reci!es%e followin& pa&e! offer -ou !ome wi'el-u!e' PHPExcel recipe!. Plea!e note t%at t%e!e 'o AJoffer complete 'ocumentation on !pecific PHPExcel $P8 function! but Yu!t a bump to &et -ou!tarte'. 8f -ou nee' !pecific $P8 function! plea!e refer to t%e $P8 'ocumentation.

    /or example 4.6.( ! pa&e orientation an' !i5ecover! !ettin& a pa&e orientationto $4. Jt%er paper format! lie < :etter are not covere' in t%i! 'ocument but in t%e PHPExcel$P8 'ocumentation.

    4.>.1. ettin) a sprea!s"eet8s meta!ata

    PHPExcel allow! an ea!- wa- to !et a !prea'!%eet>! meta'ata u!in& 'ocument propert- acce!!or!..2. ettin) a sprea!s"eet8s active s"eet%e followin& line of co'e !et! t%e active !%eet in'ex to t%e fir!t !%eet+$objPHPExcel!setActi"eS#eetInex(6);

    4.>.9. 0rite a !ate into a cell8n Excel 'ate! are !tore' a! numeric value! countin& t%e number of 'a-! elap!e' !ince 1(000101./or example t%e 'ate I20012#1I i! repre!ente' a! #(1#. 9ou can verif- t%i! in Micro!oft JfficeExcel b- enterin& t%at 'ate in a cell an' afterwar'! c%an&in& t%e number format to I_eneralI !o t%etrue numeric value i! reveale'.

    Gritin& a 'ate value in a cell con!i!t! of 2 line! of co'e.

  • 8/13/2019 PHPExcel Developer Doc

    15/46

    $objPHPExcel!getActi"eS#eet()!getSt-le(.9.)!getT%,be=o,at()!set=o,atCoe(PHPExcel_St-le_T%,be=o,at::=4R0A3_9A3E_UUUU0099SLASH)

    Excelti,e$objPHPExcel!getActi"eS#eet()!setCellVal%e(.9. Q?)$objPHPExcel!getActi"eS#eet()!getSt-le(.9.)!getT%,be=o,at()

    !set=o,atCoe(PHPExcel_St-le_T%,be=o,at::=4R0A3_9A3E_UUUU0099SLASH)

    %e above met%o'! for enterin& a 'ate all -iel' t%e !ame re!ult. PHPExcel.4. 0rite a ,ormula into a cell8n!i'e t%e Excel file formula! are alwa-! !tore' a! t%e- woul' appear in an En&li!% ver!ion ofMicro!oft Jffice Excel an' PHPExcel %an'le! all formulae internall- in t%i! format. %i! mean! t%att%e followin& rule! %ol'+

    Decimal !eparator i! I.I perio' /unction ar&ument !eparator i! II comma Matrix row !eparator i! I\I !emicolon En&li!% function name! mu!t be u!e'

    %i! i! re&ar'le!! of w%ic% lan&ua&e ver!ion of Micro!oft Jffice Excel ma- %ave been u!e' to createt%e Excel file.

    G%en t%e final worboo i! opene' b- t%e u!er Micro!oft Jffice Excel will tae care of 'i!pla-in&t%e formula accor'in& t%e application! lan&ua&e. ran!lation i! taen care of b- t%e application]

    %e followin& line of co'e write! t%e formula K8/4`)00@profit@@lo!!@L into t%e cell B. Aote t%att%e formula mu!t !tart wit% KL to mae PHPExcel reco&ni!e t%i! a! a formula.$objPHPExcel!getActi"eS#eet()!setCellVal%e(.1?..! formula can be rea' a&ain u!in& t%e followin& line of co'e+

    $&o,%la < $objPHPExcel!getActi"eS#eet()!getCell(.1?.)!getVal%e();

    8f -ou nee' t%e calculate' value of a cell u!e t%e followin& co'e. %i! i! furt%er explaine' in4.6.40.$"al%e < $objPHPExcel!getActi"eS#eet()!getCell(.1?.)!getCalc%lateVal%e();

    4.>.=. Locale ettin)s ,or #ormulae

  • 8/13/2019 PHPExcel Developer Doc

    16/46

    8f *u!!ian lan&ua&e file! aren>t available t%e !et:ocale met%o' will return an error an' En&li!%!ettin&! will be u!e' t%rou&%out.

    Jnce -ou %ave !et a locale -ou can tran!late a formula from it! internal En&li!% co'in&.$&o,%la < $objPHPExcel!getActi"eS#eet()!getCell(.1?.)!getVal%e();$tanslate=o,%la ! setVal%eExplicitmet%o' or t%esetCellVal%eExplicitmet%o' of a wor!%eet. Here>! an example+$objPHPExcel!getActi"eS#eet()!getCell(.A.)!setVal%eExplicit(.5K.PHPExcel_Cell_9ata3-pe::3UPE_T0ERIC);

    4.>.. C"an)e a cell into a clic%a'le ?6L9ou can mae a cell a clicable *: b- !ettin& it! %-perlin propert-+$objPHPExcel!getActi"eS#eet()!setCellVal%e(.E5@. .222*p#pexcel*net.);$objPHPExcel!getActi"eS#eet()!getCell(.E5@.)!getH-pelin()!setl(.#ttp:222*p#pexcel*net.);

    8f -ou want to mae a %-perlin to anot%er wor!%eet?cell u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!setCellVal%e(.E5@. .222*p#pexcel*net.);$objPHPExcel!getActi"eS#eet()!getCell(.E5@.)!getH-pelin()!setl(^s#eet:.S#eetna,e.BA);

    4.>.. ettin) a (or%s"eet8s pa)e orientation an! sie! pa&e orientation an' !i5e can be 'one u!in& t%e followin& line! of co'e+$objPHPExcel!getActi"eS#eet()!getPageSet%p()!set4ientation(PHPExcel_Gos#eet_PageSet%p::4RIET3A3I4T_LAT9SCAPE);$objPHPExcel!getActi"eS#eet()!getPageSet%p()!setPapeSi>e(PHPExcel_Gos#eet_PageSet%p::PAPERSIZE_AO);

    Aote t%at t%ere are a''itional pa&e !ettin&! available. Plea!e refer to t%e $P8 'ocumentation for allpo!!ible option!.

    4.>.1-. Pa)e etup calin) options%e pa&e !etup !calin& option! in PHPExcel relate 'irectl- to t%e !calin& option! in t%e @Pa&e

  • 8/13/2019 PHPExcel Developer Doc

    18/46

    ,et#o initial "al%e calling ,et#o 2illtigge

    Tote

    set=it3oPage(***) &alse setScale(***) 66 set=it3oPage(&alse)set=it3oGit#(***) set=it3oPage(t%e) "al%e 6 ,eans

    onot&itto

    2it#set=it3oHeig#t(***) set=it3oPage(t%e) "al%e 6 ,eansonot&itto

    #eig#t

    Example

    Here i! %ow to $it to 8 pa/e .ide , in$inite pa/es tall+

    $objPHPExcel!getActi"eS#eet()!getPageSet%p()!set=it3oGit#();$objPHPExcel!getActi"eS#eet()!getPageSet%p()!set=it3oHeig#t(6);

    $! -ou can !ee it i! not nece!!ar- to call set=it3oPage(t%e) !ince set=it3oGit#(`)an'set=it3oHeig#t(`) tri&&er! t%i!.

    8f -ou u!e set=it3oGit#()-ou !%oul' in &eneral al!o !pecif- set=it3oHeig#t()explicitl- lie int%e example. Be careful rel-in& on t%e initial value!. %i! i! e!peciall- true if -ou are up&ra'in& fromPHPExcel 1.7.0 to 1.7.1 w%ere t%e 'efault value! for fitto%ei&%t an' fittowi't% c%an&e' from 0 to 1.

    4.>.11. Pa)e mar)inso !et pa&e mar&in! for a wor!%eet u!e t%i! co'e+$objPHPExcel!getActi"eS#eet()!getPage0agins()!set3op();$objPHPExcel!getActi"eS#eet()!getPage0agins()!setRig#t(6*7K);$objPHPExcel!getActi"eS#eet()!getPage0agins()!setLe&t(6*7K);$objPHPExcel!getActi"eS#eet()!getPage0agins()!set1otto,();

    Aote t%at t%e mar&in value! are !pecifie' in inc%e!.

    PHPExcel Developer Documentation 1

  • 8/13/2019 PHPExcel Developer Doc

    19/46

    4.>.12. Center a pa)e "oriontall$/verticall$o center a pa&e %ori5ontall-?verticall- -ou can u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!getPageSet%p()!setHoi>ontalCentee(t%e);$objPHPExcel!getActi"eS#eet()!getPageSet%p()!setVeticalCentee(&alse);

    4.>.19. ettin) t"e print "ea!er an! ,ooter o, a (or%s"eet! print %ea'er an' footer can be 'one u!in& t%e followin& line! of co'e+$objPHPExcel!getActi"eS#eet()!getHeae=oote()!set4Heae(.CHPlease teatt#is oc%,ent as con&ientialB.);$objPHPExcel!getActi"eS#eet()!getHeae=oote()!set4=oote(.L1. *$objPHPExcel!getPopeties()!get3itle() * .RPage P o& T.);

  • 8/13/2019 PHPExcel Developer Doc

    20/46

    marer exi!t t%e content! from all marer! are concatenate' in t%eor'er of appearance an' place' into t%e ri&%t !ection.

    &Z o'e for @t%i! worbooI! file pat%@&F o'e for @t%i! worbooI! file name@&A o'e for @!%eet tab name@&+ o'e for a'' to pa&e &- o'e for !ubtract from pa&e &font n!"e#font t$%e o'e for @text font name@ an' @text font t-pe@ w%ere font name an'

    font t-pe are !trin&! !pecif-in& t%e name an' t-pe of t%e font!eparate' b- a comma. G%en a %-p%en appear! in font name itmean! @none !pecifie'@. Bot% of font name an' font t-pe can belocali5e' value!.

    &-#ol' o'e for @bol' font !t-le@& o'e for @bol' font !t-le@&-#Re(ul!) o'e for @re&ular font !t-le@&-#*t!li o'e for @italic font !t-le@&* o'e for @italic font !t-le@&-#ol' *t!li o'e for @bol' italic font !t-le@&,

    o'e for @outline !t-le@& o'e for @!%a'ow !t-le@

    4ip%e above table of co'e! ma- !eem overw%elmin& fir!t time -ou are tr-in& to fi&ure out %ow to write !ome%ea'er or footer. :ucil- t%ere i! an ea!ier wa-. :et Micro!oft Jffice Excel 'o t%e wor for -ou.

    /or example create in Micro!oft Jffice Excel an xlsxfile w%ere -ou in!ert t%e %ea'er an' footer a! 'e!ire'u!in& t%e pro&ram! own interface.

  • 8/13/2019 PHPExcel Developer Doc

    21/46

    4.>.1. peci,$ printin) areao !pecif- a wor!%eet>! printin& area u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!getPageSet%p()!setPintAea(.A:EK.);

    %ere can al!o be multiple printin& area! in a !in&le wor!%eet+$objPHPExcel!getActi"eS#eet()!getPageSet%p()!setPintAea(.A:EKO:056.);

    4.>.1. #ormattin) cells$ cell can be formatte' wit% font bor'er fill Z !t-le information. /or example one can !et t%efore&roun' colour of a cell to re' ali&ne' to t%e ri&%t an' t%e bor'er to blac an' t%ic bor'er!t-le. :et>! 'o t%at on cell B2+

    $objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get=ont()!getColo()!setAR1(PHPExcel_St-le_Colo::C4L4R_RE9);

    $objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!getAlign,ent()!setHoi>ontal(PHPExcel_St-le_Align,ent::H4RIZ4T3AL_RIH3);

    $objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get1oes()!get3op()!set1oeSt-le(PHPExcel_St-le_1oe::14R9ER_3HIC);$objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get1oes()!get1otto,()!set1oeSt-le(PHPExcel_St-le_1oe::14R9ER_3HIC);$objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get1oes()!getLe&t()!set1oeSt-le(PHPExcel_St-le_1oe::14R9ER_3HIC);$objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get1oes()!getRig#t()!set1oeSt-le(PHPExcel_St-le_1oe::14R9ER_3HIC);

    $objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get=ill()!set=ill3-pe(PHPExcel_St-le_=ill::=ILL_S4LI9);$objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!get=ill()!getStatColo()!setAR1(.====6666.);

  • 8/13/2019 PHPExcel Developer Doc

    22/46

    .statcolo.

    ).encolo.

    .agb.

    )

    );

    $objPHPExcel!getActi"eS#eet()!getSt-le(.A.)!appl-=o,Aa-($st-leAa-);

    Jr wit% a ran&e of cell!+

    $objPHPExcel!getActi"eS#eet()!getSt-le(.1:17.)!appl-=o,Aa-($st-leAa-);

    %i! alternative met%o' u!in& arra-! !%oul' be fa!ter in term! of execution w%enever -ou are!ettin& more t%an one !t-le propert-. But t%e 'ifference ma- barel- be mea!urable unle!! -ou %aveman- 'ifferent !t-le! in -our worboo.

    Prior to PHPExcel 1.7.0 'uplicate

  • 8/13/2019 PHPExcel Developer Doc

    23/46

    co'e loo! lie. How 'o -ou fin' itC

    %e rea'er! !%ippe' wit% PHPExcel come to t%e re!cue. :oa' -our template worboo u!in& e.&. Excel2007rea'er to reveal t%e number format co'e. Example %ow rea' a number format co'e for cell $1+

    $objReae < PHPExcel_I4=acto-::ceateReae(.Excel5667.);$objPHPExcel < $objReae!loa(.te,plate*xlsx.);

    "a_%,p($objPHPExcel!getActi"eS#eet()!getSt-le(.A.)!getT%,be=o,at()!get=o,atCoe());

    $'vance' u!er! ma- fin' it fa!ter to in!pect t%e number format co'e 'irectl- b- renamin& template.xl!x totemplate.5ip un5ippin& an' looin& for t%e relevant piece of [M: co'e %ol'in& t%e number format co'e in

    xl$styles.xml.

    4.>.2-. +li)nment an! (rap text:et>! !et vertical ali&nment to t%e top for cell! A:9O$objPHPExcel!getActi"eS#eet()!getSt-le(.A:9O.)

    !getAlign,ent()!setVetical(PHPExcel_St-le_Align,ent::VER3ICAL_34P);

    Here i! %ow to ac%ieve wrap text+$objPHPExcel!getActi"eS#eet()!getSt-le(.A:9O.)!getAlign,ent()!setGap3ext(t%e);

    4.>.21. ettin) t"e !e,ault st$le o, a (or%'oo%8t i! po!!ible to !et t%e 'efault !t-le of a worboo. :et>! !et t%e 'efault font to $rial !i5e +

    $objPHPExcel!get9e&a%ltSt-le()!get=ont()!setTa,e(.Aial.);$objPHPExcel!get9e&a%ltSt-le()!get=ont()!setSi>e(?);

    4.>.22. t$lin) cell 'or!ers

    8n PHPExcel it i! ea!- to appl- variou! bor'er! on a rectan&ular !election. Here i! %ow to appl- at%ic re' bor'er outline aroun' cell! B2+_.

    $st-leAa- < aa-(.boes.

    .o%tline.

    ))

    );$objGos#eet!getSt-le(.15:?.)!appl-=o,Aa-($st-leAa-);

    8n Micro!oft Jffice Excel t%e above operation woul' corre!pon' to !electin& t%e cell! B2+_launc%in& t%e !t-le 'ialo& c%oo!in& a t%ic re' bor'er an' clicin& on t%e @Jutline@ bor'ercomponent.

    Aote t%at t%e bor'er outline i! applie' to t%e rectan&ular !election B2+_ a! a w%ole not on eac% cellin'ivi'uall-.

    9ou can ac%ieve an- bor'er effect b- u!in& Yu!t t%e ) ba!ic bor'er! an' operatin& on a !in&le cell ata time+

    Arra, +e, 'aps to propert,leftri&%t

    topbottom'ia&onal

    &et:eft&et*i&%t

    &etop&etBottom&etDia&onal

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    24/46

    $''itional !%ortcut bor'er! come in %an'- lie in t%e example above. %e!e are t%e !%ortcutbor'er! available+

    Arra, +e, 'aps to propert,allbor'er!

    outlinein!i'evertical%ori5ontal

    &et$llBor'er!

    &etJutline&et8n!i'e&et,ertical&etHori5ontal

    $n overview of all bor'er !%ortcut! can be !een in t%e followin& ima&e+

    8f -ou !imultaneou!l- !et e.&. allbor'er! an' vertical t%en we %ave @overlappin&@ bor'er! an' one oft%e component! %a! to win over t%e ot%er w%ere t%ere i! bor'er overlap. 8n PHPExcel from weae!t to!tron&e!t bor'er! t%e li!t i! a! follow!+ allbor'er! outline?in!i'e vertical?%ori5ontalleft?ri&%t?top?bottom?'ia&onal.

    %i! bor'er %ierarc%- can be utili5e' to ac%ieve variou! effect! in an ea!- manner.

    4.>.29. Con!itional ,ormattin) a cell$ cell can be formatte' con'itionall- ba!e' on a !pecific rule. /or example one can !et t%efore&roun' colour of a cell to re' if it! value i! below 5ero an' to &reen if it! value i! 5ero or more.

    Jne can !et a con'itional !t-le rule!et to a cell u!in& t%e followin& co'e+$objConitional < ne2 PHPExcel_St-le_Conitional();

    $objConitional!setConition3-pe(PHPExcel_St-le_Conitional::C4T9I3I4T_CELLIS);$objConitional!set4peato3-pe(PHPExcel_St-le_Conitional::4PERA34R_LESS3HAT);$objConitional!aConition(.6.);$objConitional!getSt-le()!get=ont()!getColo()!setAR1(PHPExcel_St-le_Colo::C4L4R_RE9);$objConitional!getSt-le()!get=ont()!set1ol(t%e);

    $objConitional5 < ne2 PHPExcel_St-le_Conitional();$objConitional5!setConition3-pe(PHPExcel_St-le_Conitional::C4T9I3I4T_CELLIS);$objConitional5!set4peato3-pe(PHPExcel_St-le_Conitional::4PERA34R_REA3ER3HAT4REAL);$objConitional5!aConition(.6.);$objConitional5!getSt-le()!get=ont()!getColo()!setAR1(PHPExcel_St-le_Colo::C4L4R_REET);

    $objConitional5!getSt-le()!get=ont()!set1ol(t%e);

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    25/46

    $conitionalSt-les < $objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!getConitionalSt-les();aa-_p%s#($conitionalSt-les $objConitional);aa-_p%s#($conitionalSt-les $objConitional5);$objPHPExcel!getActi"eS#eet()!getSt-le(.15.)!setConitionalSt-les($conitionalSt-les);

    8f -ou want to cop- t%e rule!et to ot%er cell! -ou can 'uplicate t%e !t-le obYect+$objPHPExcel!getActi"eS#eet()!%plicateSt-le( $objPHPExcel!getActi"eS#eet()!getSt-le(.15.) .1:17. );

    4.>.24. +!! a comment to a cello a'' a comment to a cell u!e t%e followin& co'e. %e example below a''! a comment to cellE11+$objPHPExcel!getActi"eS#eet()!getCo,,ent(.E.)!setA%t#o(.PHPExcel.);$objCo,,entRic#3ext < $objPHPExcel!getActi"eS#eet()!getCo,,ent(.E.)!get3ext()!ceate3extR%n(.PHPExcel:.);

    $objCo,,entRic#3ext!get=ont()!set1ol(t%e);

    $objPHPExcel!getActi"eS#eet()!getCo,,ent(.E.)!get3ext()!ceate3extR%n(/FFn/);

    $objPHPExcel!getActi"eS#eet()!getCo,,ent(.E.)!get3ext()!ceate3extR%n(.3otala,o%nt on t#e c%ent in"oice excl%ing VA3*.);

    4.>.2=. +ppl$ auto,ilter to a ran)e o, cellso appl- an autofilter to a ran&e of cell! u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!setA%to=ilte(.A:CQ.);

    'a+e sure that ,ou al.a,s include the co%plete $ilter ran/eExcel 'oe! !upport !ettin& onl- t%e caption row but t%atI! nota be!t practice...

    4.>.2>. ettin) securit$ on a sprea!s"eetExcel offer! # level! of KprotectionL+ 'ocument !ecurit- !%eet !ecurit- an' cell !ecurit-.

    Document !ecurit- allow! -ou to !et a pa!!wor' on a complete !prea'!%eet allowin&c%an&e! to be ma'e onl- w%en t%at pa!!wor' i! entere'.

    Gor!%eet !ecurit- offer! ot%er !ecurit- option!+ -ou can 'i!allow in!ertin& row! on a!pecific !%eet 'i!allow !ortin& Z

    ell !ecurit- offer! t%e option to loc?unloc a cell a! well a! !%ow?%i'e t%e internalformula

    $n example on !ettin& 'ocument !ecurit-+$objPHPExcel!getSec%it-()!setLocGino2s(t%e);

    $objPHPExcel!getSec%it-()!setLocSt%ct%e(t%e);$objPHPExcel!getSec%it-()!setGobooPass2o(/PHPExcel/);

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    26/46

    $n example on !ettin& wor!%eet !ecurit-+$objPHPExcel!getActi"eS#eet()!getPotection()!setPass2o(.PHPExcel.);$objPHPExcel!getActi"eS#eet()!getPotection()!setS#eet(t%e);$objPHPExcel!getActi"eS#eet()!getPotection()!setSot(t%e);$objPHPExcel!getActi"eS#eet()!getPotection()!setInsetRo2s(t%e);$objPHPExcel!getActi"eS#eet()!getPotection()!set=o,atCells(t%e);

    $n example on !ettin& cell !ecurit-+$objPHPExcel!getActi"eS#eet()!getSt-le(.1.)!getPotection()!setLoce(

    PHPExcel_St-le_Potection::PR43EC3I4T_TPR43EC3E9);

    'a+e sure ,ou enale .or+sheet protection i$ ,ou need an, o$ the .or+sheet protection $eatures%i! can be 'one u!in& t%e followin& co'e+ obYPHPExcel`&et$ctive

  • 8/13/2019 PHPExcel Developer Doc

    27/46

    $objPHPExcel!getActi"eS#eet()!getCell(.1?.)!set9ataValiation(clone$objValiation);

    4.>.2. ettin) a column8s (i!t"$ column>! wi't% can be !et u!in& t%e followin& co'e+

    $objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.9.)!setGit#(5);

    8f -ou want PHPExcel to perform an automatic wi't% calculation u!e t%e followin& co'e. PHPExcelwill approximate t%e column wit% to t%e wi't% of t%e wi'e!t column value.$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.1.)!setA%toSi>e(t%e);

    %e mea!ure for column wi't% in PHPExcel 'oe!

    notcorre!pon' exactl- to t%e mea!ure -ou ma-be u!e' to in Micro!oft Jffice Excel. olumnwi't%! are 'ifficult to 'eal wit% in Excel an't%ere are !everal mea!ure! for t%e columnwi't%.

    1 ;nner .idth in character unitse.&. .4#t%i! i! probabl- w%at -ou are familiar wit% inExcel2 #ull .idth in pixelse.&. 64 pixel!# #ull .idth in character unitse.&. (.14062) value 1 in'icate! un!et wi't%

    PHPExcel al.a,s operates .ith .2. "o(/"i!e a columno !et a wor!%eet>! column vi!ibilit- -ou can u!e t%e followin& co'e. %e fir!t line explicitl- !%ow!

    t%e column t%e !econ' line %i'e! column D.$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.C.)!setVisible(t%e);$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.9.)!setVisible(&alse);

    4.>.9-. Froup/outline a columno &roup?outline a column -ou can u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.E.)!set4%tlineLe"el();

    9ou can al!o collap!e t%e column. Aote t%at -ou !%oul' al!o !et t%e column invi!ible ot%erwi!e t%ecollap!e will not be vi!ible in Excel 2007.$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.E.)!setCollapse(t%e);$objPHPExcel!getActi"eS#eet()!getCol%,n9i,ension(.E.)!setVisible(&alse);

    Plea!e refer to t%e part K&roup?outline a rowL for a complete example on collap!in&.

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    28/46

    9ou can in!truct PHPExcel to a'' a !ummar- to t%e ri&%t 'efault or to t%e left. %e followin&co'e a''! t%e !ummar- to t%e left+$objPHPExcel!getActi"eS#eet()!setS#o2S%,,a-Rig#t(&alse);

    4.>.91. ettin) a ro(8s "ei)"t

    $ row>! %ei&%t can be !et u!in& t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!getRo29i,ension(.6.)!setRo2Heig#t(66);

    4.>.92. "o(/"i!e a ro(o !et a wor!%eet>! row vi!ibilit- -ou can u!e t%e followin& co'e. %e followin& example %i'e! rownumber 10.$objPHPExcel!getActi"eS#eet()!getRo29i,ension(.6.)!setVisible(&alse);

    4.>.99. Froup/outline a ro(o &roup?outline a row -ou can u!e t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!getRo29i,ension(.K.)!set4%tlineLe"el();

    9ou can al!o collap!e t%e row. Aote t%at -ou !%oul' al!o !et t%e row invi!ible ot%erwi!e t%ecollap!e will not be vi!ible in Excel 2007.$objPHPExcel!getActi"eS#eet()!getRo29i,ension(.K.)!setCollapse(t%e);$objPHPExcel!getActi"eS#eet()!getRo29i,ension(.K.)!setVisible(&alse);

    Here>! an example w%ic% collap!e! row! )0 to 0+&o ($i < K; $i D< ?6; $i)

    $objPHPExcel!getActi"eS#eet()!setCellVal%e(.A. * $i /=Ta,e $i/);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.1. * $i /LTa,e $i/);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.C. * $i /P#oneTo $i/);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.9. * $i /=axTo $i/);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.E. * $i t%e);

    $objPHPExcel!getActi"eS#eet()!getRo29i,ension($i)!set4%tlineLe"el();$objPHPExcel!getActi"eS#eet()!getRo29i,ension($i)!setVisible(&alse);+$objPHPExcel!getActi"eS#eet()!getRo29i,ension(?)!setCollapse(t%e);

    9ou can in!truct PHPExcel to a'' a !ummar- below t%e collap!ible row! 'efault or above. %efollowin& co'e a''! t%e !ummar- above+$objPHPExcel!getActi"eS#eet()!setS#o2S%,,a-1elo2(&alse);

    4.>.94. Mer)e/unmer)e cells8f -ou %ave a bi& piece of 'ata -ou want to 'i!pla- in a wor!%eet -ou can mer&e two or more cell!to&et%er to become one cell. %i! can be 'one u!in& t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!,egeCells(.A?:E55.);

    *emovin& a mer&e can be 'one u!in& t%e %n,egeCellsmet%o'+$objPHPExcel!getActi"eS#eet()!%n,egeCells(.A?:E55.);

    4.>.9=. ;nsertin) ro(s/columns9ou can in!ert?remove row!?column! at a !pecific po!ition. %e followin& co'e in!ert! 2 new row!ri&%t before row 7+$objPHPExcel!getActi"eS#eet()!insetTe2Ro21e&oe(7 5);

    4.>.9>. +!! a !ra(in) to a (or%s"eet$ 'rawin& i! alwa-! repre!ente' a! a !eparate obYect w%ic% can be a''e' to a wor!%eet.

    %erefore -ou mu!t fir!t in!tantiate a new PHPExcel_Gos#eet_9a2ing an' a!!i&n it! propertie!a meanin&ful value+

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    29/46

    $obj9a2ing < ne2 PHPExcel_Gos#eet_9a2ing();$obj9a2ing!setTa,e(.Logo.);$obj9a2ing!set9esciption(.Logo.);$obj9a2ing!setPat#(.*i,ageso&&icelogo*jpg.);$obj9a2ing!setHeig#t(@);

    o a'' t%e above 'rawin& to t%e wor!%eet u!e t%e followin& !nippet of co'e. PHPExcel create!t%e lin between t%e 'rawin& an' t%e wor!%eet+$obj9a2ing!setGos#eet($objPHPExcel!getActi"eS#eet());

    9ou can !et numerou! propertie! on a 'rawin& %ere are !ome example!+$obj9a2ing!setTa,e(.Pai.);$obj9a2ing!set9esciption(.Pai.);$obj9a2ing!setPat#(.*i,agespai*png.);$obj9a2ing!setCooinates(.1K.);$obj9a2ing!set4&&set8(6);$obj9a2ing!setRotation(5K);$obj9a2ing!getS#ao2()!setVisible(t%e);$obj9a2ing!getS#ao2()!set9iection(OK);

    4.>.9. +!! ric" text to a cell$''in& ric% text to a cell can be 'one u!in& PHPExcel_Ric#3extin!tance!. Here>! an examplew%ic% create! t%e followin& ric% text !trin&+

    %i! invoice i!payable within thirty days after the end of the monthunle!! !pecifie' ot%erwi!eon t%e invoice.

    $objRic#3ext < ne2 PHPExcel_Ric#3ext();$objRic#3ext!ceate3ext(.3#is in"oice is .);

    $objPa-able < $objRic#3ext!ceate3extR%n(.pa-able 2it#in t#it- a-s a&te t#e eno& t#e ,ont#.);$objPa-able!get=ont()!set1ol(t%e);$objPa-able!get=ont()!setItalic(t%e);$objPa-able!get=ont()!setColo( ne2PHPExcel_St-le_Colo( PHPExcel_St-le_Colo::C4L4R_9ARREET ) );

    $objRic#3ext!ceate3ext(. %nless speci&ie ot#e2ise on t#e in"oice*.);

    $objPHPExcel!getActi"eS#eet()!getCell(.A?.)!setVal%e($objRic#3ext);

    4.>.9. De,ine a name! ran)ePHPExcel !upport! t%e 'efinition of name' ran&e!. %e!e can be 'efine' u!in& t%e followin& co'e+ A so,e ata$objPHPExcel!setActi"eS#eetInex(6);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.A. .=istna,e:.);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.A5. .Lastna,e:.);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.1. .0aaten.);$objPHPExcel!getActi"eS#eet()!setCellVal%e(.15. .1allia%2.);

    9e&ine na,e anges$objPHPExcel!aTa,eRange( ne2 PHPExcel_Ta,eRange(.Peson=T. $objPHPExcel!getActi"eS#eet() .1.) );$objPHPExcel!aTa,eRange( ne2 PHPExcel_Ta,eRange(.PesonLT. $objPHPExcel!getActi"eS#eet() .15.) );

    Jptionall- a fourt% parameter can be pa!!e' 'efinin& t%e name' ran&e local i.e. onl- u!able ont%e current wor!%eet. Aame' ran&e! are &lobal b- 'efault.

    PHPExcel Developer Documentation 2

  • 8/13/2019 PHPExcel Developer Doc

    30/46

    4.>.9. 6e!irect output to a client8s (e' 'ro(ser! brow!er e!peciall- w%en creatin&!prea'!%eet! ont%efl-. %ere are !ome ea!- !tep! t%at can be followe' to 'o t%i!+

    1. reate -our PHPExcel !prea'!%eet2. Jutput HP %ea'er! for t%e t-pe of 'ocument -ou wi!% to output#. !e t%e PHPExcelGriter of -our c%oice an' !ave to Kp%p+??outputL

    PHPExcelGriterExcel2007 u!e! temporar- !tora&e w%en writin& to p%p+??output. B- 'efaulttemporar- file! are !tore' in t%e !cript>! worin& 'irector-. G%en t%ere i! no acce!! it fall! bac tot%e operatin& !-!tem>! temporar- file! location.

    4his %a, not e sa$e $or unauthorized 6ie.in/Depen'in& on t%e confi&uration of -our operatin& !-!tem temporar- !tora&e can be rea' b- an-one u!in& t%e!ame temporar- !tora&e fol'er. G%en confi'entialit- of -our 'ocument i! nee'e' it i! recommen'e' not tou!e p%p+??output.

    H&&P "ea!ers

    Example of a !cript re'irectin& an Excel 2007 file to t%e clientI! brow!er+

    DJp#pM Hee t#ee 2ill be so,e coe 2#ee -o% ceate $objPHPExcel M

    eiect o%tp%t to client bo2se#eae(.Content3-pe: application"n*openx,l&o,atso&&iceoc%,ent*speas#eet,l*s#eet.);#eae(.Content9isposition: attac#,ent;&ilena,e

  • 8/13/2019 PHPExcel Developer Doc

    31/46

    4.>.41. ettin) t"e !e,ault ro( "ei)"tDefault row %ei&%t can be !et u!in& t%e followin& co'e+$objPHPExcel!getActi"eS#eet()!get9e&a%ltRo29i,ension()!setRo2Heig#t(K);

    4.>.42. +!! a FD !ra(in) to a (or%s"eet

    %ere mi&%t be a !ituation w%ere -ou want to &enerate an inmemor- ima&e u!in& _D an' a'' it toa PHPExcel wor!%eet wit%out fir!t %avin& to !ave t%i! file to a temporar- location.

    Here>! an example w%ic% &enerate! an ima&e in memor- an' a''! it to t%e active wor!%eet+ eneate an i,age$gI,age < i,ageceatet%ecolo(56 56) o ie(.Cannot Initiali>e ne2 9 i,agestea,.);$textColo < i,agecoloallocate($gI,age 5KK 5KK 5KK);i,agesting($gI,age K K .Ceate 2it# PHPExcel. $textColo);

    A a a2ing to t#e 2os#eet$obj9a2ing < ne2 PHPExcel_Gos#eet_0e,o-9a2ing();$obj9a2ing!setTa,e(.Sa,ple i,age.);$obj9a2ing!set9esciption(.Sa,ple i,age.);

    $obj9a2ing!setI,ageReso%ce($gI,age);$obj9a2ing!setReneing=%nction(PHPExcel_Gos#eet_0e,o-9a2ing::RET9ERIT_fPE);$obj9a2ing!set0i,e3-pe(PHPExcel_Gos#eet_0e,o-9a2ing::0I0E3UPE_9E=AL3);$obj9a2ing!setHeig#t(@);$obj9a2ing!setGos#eet($objPHPExcel!getActi"eS#eet());

    4.>.49. ettin) (or%s"eet oom levelo !et a wor!%eet>! 5oom level t%e followin& co'e can be u!e'+$objPHPExcel!getActi"eS#eet()!getS#eetVie2()!setZoo,Scale(7K);

    Aote t%at 5oom level !%oul' be in ran&e 10 400.

    4.>.44. "eet ta' color

  • 8/13/2019 PHPExcel Developer Doc

    32/46

    4.>.4. 6i)"tGtoGle,t (or%s"eetGor!%eet! can be !et in'ivi'uall- w%et%er column $> !%oul' !tart at left or ri&%t !i'e. Default i!left. Here i! %ow to !et column! from ri&%ttoleft.

    ig#ttole&t 2os#eet$objPHPExcel!getActi"eS#eet()

    !setRig#t3oLe&t(t%e);

    PHPExcel Developer Documentation #

  • 8/13/2019 PHPExcel Developer Doc

    33/46

    =. Per,ormin) ,ormula calculations

    #.1. Using the &'&()cel calculation engine$! PHPExcel repre!ent! an inmemor- !prea'!%eet it al!o offer! formula calculation capabilitie!. $

    cell can be of a value t-pe containin& a number or text or a formula t-pe containin& a formulaw%ic% can be evaluate'. /or example t%e formula @! met%o'getCalc%lateVal%e() for example+$objPHPExcel!getActi"eS#eet()!getCell(.E.)!getCalc%lateVal%e();

    8f -ou write t%e followin& line of co'e in t%e invoice 'emo inclu'e' wit% PHPExcel it evaluate! tot%e value @64@+

    $not%er nice feature of PHPExcelI! formula par!er i! t%at it can automaticall- a'Yu!t a formulaw%en in!ertin&?removin& row!?column!. HereI! an example+

    9ou !ee t%at t%e formula containe' in cell E11 i! @

  • 8/13/2019 PHPExcel Developer Doc

    34/46

    Di' -ou noticeC %e formula in t%e former cell E11 now E1# a! 8 in!erte' 2 new row! c%an&e' to@

  • 8/13/2019 PHPExcel Developer Doc

    35/46

    >. 6ea!in) an! (ritin) to ,ile$! -ou alrea'- now from part #.4 *ea'er! an' writer! rea'in& an' writin& to a per!i!te' !tora&e i!not po!!ible u!in& t%e ba!e PHPExcel cla!!e!. /or t%i! purpo!e PHPExcel provi'e! rea'er! an'writer! w%ic% are implementation! of PHPExcelGriter8*ea'er an' PHPExcelGriter8Griter.

    .1. &'&()cel0I$actor%e PHPExcel $P8 offer! multiple met%o'! to create a PHPExcelGriter8*ea'er orPHPExcelGriter8Griter in!tance+

    Direct creation

    ,ia PHPExcel8J/actor-

    $ll example! un'erneat% 'emon!trate t%e 'irect creation met%o'. Aote t%at -ou can al!o u!e t%ePHPExcel8J/actor- cla!! to 'o t%i!.

    >.1.1. Creatin) PHPExcel6ea!er;6ea!er usin) PHPExcel;O#actor$%ere are 2 met%o'! for rea'in& in a file into PHPExcel+ u!in& automatic file t-pe re!olvin& orexplicitl-.

    $utomatic file t-pe re!olvin& c%ec! t%e 'ifferent PHPExcel*ea'er8*ea'er 'i!tribute' wit%PHPExcel. 8f one of t%em can loa' t%e !pecifie' file name t%e file i! loa'e' u!in& t%atPHPExcel*ea'er8*ea'er. Explicit mo'e re"uire! -ou to !pecif- w%ic% PHPExcel*ea'er8*ea'er!%oul' be u!e'.

    9ou can create a PHPExcel*ea'er8*ea'er in!tance u!in& PHPExcel8J/actor- in automatic filet-pe re!olvin& mo'e u!in& t%e followin& co'e !ample+$objPHPExcel < PHPExcel_I4=acto-::loa(/6K&eat%ee,o*xlsx/);

    $ t-pical u!e of t%i! feature i! w%en -ou nee' to rea' file! uploa'e' b- -our u!er! an' -ou 'on>tnow w%et%er t%e- are uploa'in& xl! or xl!x file!.

    8f -ou nee' to !et !ome propertie! on t%e rea'er e.&. to onl- rea' 'ata !ee more about t%i!later t%en -ou ma- in!tea' want to u!e t%i! variant+$objReae < PHPExcel_I4=acto-::ceateReae=o=ile(/6K&eat%ee,o*xlsx/);$objReae!setRea9ata4nl-(t%e);$objReae!loa(/6K&eat%ee,o*xlsx/);

    9ou can create a PHPExcel*ea'er8*ea'er in!tance u!in& PHPExcel8J/actor- in explicit mo'eu!in& t%e followin& co'e !ample+$objReae < PHPExcel_I4=acto-::ceateReae(/Excel5667/);$objPHPExcel < $objReae!loa(/6K&eat%ee,o*xlsx/);

    Aote t%at automatic t-pe re!olvin& mo'e i! !li&%tl- !lower t%an explicit mo'e.

    >.1.2. Creatin) PHPExcel0riter;0riter usin) PHPExcel;O#actor$9ou can create a PHPExcelGriter8writer in!tance u!in& PHPExcel8J/actor-+$objGite < PHPExcel_I4=acto-::ceateGite($objPHPExcel /Excel5667/);$objGite!sa"e(/6K&eat%ee,o*xlsx/);

    .2. ()cel 2 S!readsheet5L6 file format

    Excel2007 file format i! t%e main file format of PHPExcel. 8t allow! outputtin& t%e inmemor-!prea'!%eet to a .xl!x file.

    PHPExcel Developer Documentation #

  • 8/13/2019 PHPExcel Developer Doc

    36/46

    >.2.1. PHPExcel6ea!erExcel2--

    6ea!in) a sprea!s"eet

    9ou can rea' an .xl!x file u!in& t%e followin& co'e+$objReae < ne2 PHPExcel_Reae_Excel5667();$objPHPExcel < $objReae!loa(/6K&eat%ee,o*xlsx/);

    6ea! !ata onl$

    9ou can !et t%e option !et*ea'DataJnl- on t%e rea'er to in!truct t%e rea'er to i&nore !t-lin& 'atavali'ation Z an' Yu!t rea' cell 'ata+$objReae < ne2 PHPExcel_Reae_Excel5667();$objReae!setRea9ata4nl-(t%e);$objPHPExcel < $objReae!loa(/6K&eat%ee,o*xlsx/);

    6ea! speci,ic s"eets onl$

    9ou can !et t%e option !et:oa'

  • 8/13/2019 PHPExcel Developer Doc

    37/46

    O,,ice 2--9 compati'ilit$ pac%

    Becau!e of a bu& in t%e Jffice200# compatibilit- pac t%ere can be !ome !mall i!!ue! w%en openin&Excel2007 !prea'!%eet! mo!tl- relate' to formula calculation. 9ou can enable Jffice200#compatibilit- wit% t%e followin& co'e+$objGite < ne2 PHPExcel_Gite_Excel5667($objPHPExcel);$objGite!set4&&ice566Co,patibilit-(t%e);

    $objGite!sa"e(/6K&eat%ee,o*xlsx/);

    !$$ice200< co%patiilit, should onl, e used .hen neededJffice200# compatibilit- option !%oul' onl- be u!e' w%en nee'e'. %i! option 'i!able! !everal Jffice2007 fileformat option! re!ultin& in a lowerfeature' Jffice2007 !prea'!%eet w%en t%i! option i! u!e'.

    .3. ()cel # 7I$$6 file formatExcel) file format i! t%e ol' Excel file format implemente' in PHPExcel to provi'e a uniformmanner to create bot% .xl!x an' .xl! file!. 8t i! ba!icall- a mo'ifie' ver!ion of PE$*.9.1. PHPExcel6ea!erExcel=

    6ea!in) a sprea!s"eet

    9ou can rea' an .xl! file u!in& t%e followin& co'e+$objReae < ne2 PHPExcel_Reae_ExcelK();$objPHPExcel < $objReae!loa(/6K&eat%ee,o*xls/);

    6ea! !ata onl$

    9ou can !et t%e option !et*ea'DataJnl- on t%e rea'er to in!truct t%e rea'er to i&nore !t-lin& 'atavali'ation Z an' Yu!t rea' cell 'ata+$objReae < ne2 PHPExcel_Reae_ExcelK();$objReae!setRea9ata4nl-(t%e);$objPHPExcel < $objReae!loa(/6K&eat%ee,o*xls/);

    6ea! speci,ic s"eets onl$

    9ou can !et t%e option !et:oa'

  • 8/13/2019 PHPExcel Developer Doc

    38/46

    +

    et%n &alse;+

    +

    $objReae < ne2 PHPExcel_Reae_ExcelK();

    $objReae!setRea=ilte( ne2 0-Rea=ilte() );$objPHPExcel < $objReae!loa(/6@lagescale*xls/);

    >.9.2. PHPExcel0riterExcel=

    0ritin) a sprea!s"eet

    9ou can write an .xl! file u!in& t%e followin& co'e+$objGite < ne2 PHPExcel_Gite_ExcelK($objPHPExcel);$objGite!sa"e(/6K&eat%ee,o*xls/);

    .4. ()cel 23 85L file format

    Excel 200# [M: file format i! a file format w%ic% can be u!e' in ol'er ver!ion! of Micro!oft Excel. Excel 200< &'( li%itationsPlea!e note t%at Excel 200# [M: format %a! !ome limit! re&ar'in& to !t-lin& cell! an' %an'lin& lar&e!prea'!%eet! via PHP.

    >.4.1. PHPExcel6ea!erExcel2--9XML

    6ea!in) a sprea!s"eet

    9ou can rea' an .xml file u!in& t%e followin& co'e+$objReae < ne2 PHPExcel_Reae_Excel56680L();$objPHPExcel < $objReae!loa(/6K&eat%ee,o*x,l/);

    6ea! speci,ic cells onl$

    9ou can !et t%e option !et*ea'/ilter on t%e rea'er to in!truct t%e rea'er to onl- loa' t%e cell!w%ic% matc% a &iven rule. $ rea' filter can be an- cla!! w%ic% implement!PHPExcel*ea'er8*ea'/ilter. B- 'efault all cell! are rea' u!in& t%ePHPExcel*ea'erDefault*ea'/ilter.

    %e followin& co'e will onl- rea' row 1 an' row! 20 #0 of an- !%eet in t%e Excel file+class 0-Rea=ilte i,ple,ents PHPExcel_Reae_IRea=ilte

    p%blic &%nction eaCell($col%,n $o2 $2os#eetTa,e < ..) Rea title o2 an o2s 56 6i& ($o2

  • 8/13/2019 PHPExcel Developer Doc

    39/46

    BC( li%itationsPlea!e note t%at .=.1. PHPExcel6ea!er7L

    6ea!in) a sprea!s"eet

    9ou can rea' an .!l file u!in& t%e followin& co'e+$objReae < ne2 PHPExcel_Reae_SUL();$objPHPExcel < $objReae!loa(/6K&eat%ee,o*sl/);

    6ea! speci,ic cells onl$

    9ou can !et t%e option !et*ea'/ilter on t%e rea'er to in!truct t%e rea'er to onl- loa' t%e cell!w%ic% matc% a &iven rule. $ rea' filter can be an- cla!! w%ic% implement!PHPExcel*ea'er8*ea'/ilter. B- 'efault all cell! are rea' u!in& t%ePHPExcel*ea'erDefault*ea'/ilter.

    %e followin& co'e will onl- rea' row 1 an' row! 20 #0 of an- !%eet in t%e

  • 8/13/2019 PHPExcel Developer Doc

    40/46

    $objReae < ne2 PHPExcel_Reae_CSV();$objReae!setInp%tEncoing(.CP5K5.);$objReae!set9eli,ite(.;.);$objReae!setEnclos%e(..);$objReae!setLineEning(/FFn/);$objReae!setS#eetInex(6);$objPHPExcel < $objReae!loa(/sa,ple*cs"/);

    6ea! a speci,ic (or%s"eet

  • 8/13/2019 PHPExcel Developer Doc

    41/46

    Decimal an! t"ousan!s separators

    8f t%e wor!%eet -ou are exportin& contain! number! wit% 'ecimal or t%ou!an'! !eparator! t%en -ou!%oul' t%in about w%at c%aracter! -ou want to u!e for t%o!e before 'oin& t%e export.

    B- 'efault PHPExcel loo! up in t%e !erver>! locale !ettin&! to 'eci'e w%at c%aracter! to u!e. But toavoi' problem! it i! recommen'e' to !et t%e c%aracter! explicitl- a! !%own below.

    En&li!% u!er! will want to u!e t%i! before 'oin& t%e export+eN%ie_once .PHPExcelS#aeSting*p#p.PHPExcel_S#ae_Sting::set9eci,alSepaato(.*.);PHPExcel_S#ae_Sting::set3#o%sansSepaato(..);

    _erman u!er! will want to u!e t%e oppo!ite value!.eN%ie_once .PHPExcelS#aeSting*p#p.PHPExcel_S#ae_Sting::set9eci,alSepaato(..);PHPExcel_S#ae_Sting::set3#o%sansSepaato(.*.);

    Aote t%at t%e above co'e !et! 'ecimal an' t%ou!an' !eparator! a! &lobal option!. %i! al!o affect!%ow HM: an' PD/ i! exporte'.

    .. '%5LPHPExcel allow! -ou to write a !prea'!%eet into HM: format for "uic repre!entation of t%e 'atain it to an-one w%o 'oe! not %ave a !prea'!%eet application on t%eir P.

    H4'( li%itationsPlea!e note t%at HM: file format %a! !ome limit! re&ar'in& to !t-lin& cell! number formattin& Z

    >..1. PHPExcel0riterH&ML

    Plea!e note t%at PHPExcelGriterHM: onl- output! t%e fir!t wor!%eet b- 'efault.

    0ritin) a sprea!s"eet

    9ou can write a .%tm file u!in& t%e followin& co'e+$objGite < ne2 PHPExcel_Gite_H30L($objPHPExcel);$objGite!sa"e(/6K&eat%ee,o*#t,/);

    0rite all (or%s"eets

    HM: file! can contain one or more wor!%eet!. 8f -ou want to write all !%eet! into a !in&le HM:file u!e t%e followin& co'e+$objGite!2iteAllS#eets();

    0rite a speci,ic (or%s"eet

    HM: file! can contain one or more wor!%eet!. %erefore -ou can !pecif- w%ic% !%eet to write toHM:+$objGite!setS#eetInex(6);

    ettin) t"e ima)es root o, t"e H&ML ,ile

    %ere mi&%t be !ituation! w%ere -ou want to explicitl- !et t%e inclu'e' ima&e! root. /or exampleone mi&%t want to !ee Di,g st-le

  • 8/13/2019 PHPExcel Developer Doc

    42/46

    #ormula preGcalculation

    B- 'efault t%i! writer precalculate! all formula! in t%e !prea'!%eet. %i! can be !low on lar&e!prea'!%eet! an' ma-be even unwante'. 9ou can %owever 'i!able formula precalculation+$objGite < ne2 PHPExcel_Gite_H30L($objPHPExcel);$objGite!setPeCalc%late=o,%las(&alse);$objGite!sa"e(/6K&eat%ee,o*#t,/);

    Em'e!!in) )enerate! H&ML in a (e' pa)e

    %ere mi&%t be a !ituation w%ere -ou want to embe' t%e &enerate' HM: in an exi!tin& web!ite.PHPExcelGriterHM: provi'e! !upport to &enerate onl- !pecific part! of t%e HM: co'e w%ic%allow! -ou to u!e t%e!e part! in -our web!ite.

    e: Qpt; bacgo%ncolo: 2#ite;

    +

    DJp#pec#o $objGite!geneateSt-les(&alse); o not 2ite Dst-le! an Dst-le!J!

    !Dst-le!

    DJp#pec#o $objGite!geneateS#eet9ata();ec#o $objGite!geneateH30L=oote();J!

    0ritin) ?G H&ML ,iles$ HM: file can be mare' a! / b- writin& a BJM file %ea'er. %i! can be enable' b- u!in& t%efollowin& co'e+$objGite < ne2 PHPExcel_Gite_H30L($objPHPExcel);$objGite!setse140(t%e);$objGite!sa"e(/6K&eat%ee,o*#t,/);

    Decimal an! t"ousan!s separators

  • 8/13/2019 PHPExcel Developer Doc

    43/46

    PD# li%itationsPlea!e note t%at PD/ file format %a! !ome limit! re&ar'in& to !t-lin& cell! number formattin& Z

    >..1. PHPExcel0riterPD#

    Plea!e note t%at PHPExcelGriterPD/ onl- output! t%e fir!t wor!%eet b- 'efault.

    0ritin) a sprea!s"eet

    9ou can write a .p'f file u!in& t%e followin& co'e+$objGite < ne2 PHPExcel_Gite_P9=($objPHPExcel);$objGite!sa"e(/6K&eat%ee,o*p&/);

    0rite all (or%s"eets

    PD/ file! can contain one or more wor!%eet!. 8f -ou want to write all !%eet! into a !in&le PD/ fileu!e t%e followin& co'e+$objGite!2iteAllS#eets();

    0rite a speci,ic (or%s"eetPD/ file! can contain one or more wor!%eet!. %erefore -ou can !pecif- w%ic% !%eet to write toPD/+$objGite!setS#eetInex(6);

    #ormula preGcalculation

    B- 'efault t%i! writer precalculate! all formula! in t%e !prea'!%eet. %i! can be !low on lar&e!prea'!%eet! an' ma-be even unwante'. 9ou can %owever 'i!able formula precalculation+$objGite < ne2 PHPExcel_Gite_P9=($objPHPExcel);$objGite!setPeCalc%late=o,%las(&alse);$objGite!sa"e(/6K&eat%ee,o*p&/);

    Decimal an! t"ousan!s separators write6*ea'er! an' writer! are t%e tool! t%at allow -ou to &enerate Excel file! from template!. %i!re"uire! le!! co'in& effort t%an &eneratin& t%e Excel file from !cratc% e!peciall- if -our template%a! man- !t-le! pa&e !etup propertie! %ea'er! etc.

    Here i! an example %ow to open a template file fill in a couple of fiel'! an' !ave it a&ain+$objPHPexcel < PHPExcel_I4=acto-::loa(.te,plate*xlsx.);

    $objGos#eet < $objPHPexcel!getActi"eS#eet();$objGos#eet!getCell(.A.)!setVal%e(.fo#n.);$objGos#eet!getCell(.A5.)!setVal%e(.S,it#.);

    $objGite < PHPExcel_I4=acto-::ceateGite($objPHPexcel .ExcelK.);$objGite!sa"e(.2ite*xls.);

    Aotice t%at it i! o to loa' an xl!x file an' &enerate an xl! file.

    PHPExcel Developer Documentation 4

  • 8/13/2019 PHPExcel Developer Doc

    44/46

    . Cre!itsPlea!e refer to t%e internet pa&e %ttp+??www.co'eplex.com?PHPExcel?Gii?,iew.a!pxCtitlere'it!Freferrin&itleHomefor upto'ate cre'it!.

    PHPExcel Developer Documentation 4

    http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=Credits&referringTitle=Homehttp://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=Credits&referringTitle=Homehttp://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=Credits&referringTitle=Homehttp://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=Credits&referringTitle=Home
  • 8/13/2019 PHPExcel Developer Doc

    45/46

    +ppen!ix + Iali! arra$ %e$s ,or st$le appl$#rom+rra$3%e followin& table li!t! t%e vali' arra- e-! for PHPExcel

  • 8/13/2019 PHPExcel Developer Doc

    46/46

    rotationwrap!%rino/itin'ent

    !etext*otation!etGrapext!et


Recommended