php - $xml->writeData(); not working on ExcelWriterXML -
i running on mac, xml file creating data not written file. please, kindly help.
<?php include('excelwriterxml.php'); /** * @source */ $xml->doctitle('my demo doc'); $xml->docauthor('robert f greer'); $xml->doccompany('greers.org'); $xml->docmanager('wife'); /** * choose show formatting/input errors on seperate sheet */ $xml->showerrorsheet(true); /** * show style options */ $format1 = $xml->addstyle('left_rotate60_big'); $format1->alignrotate(60); $format1->alignhorizontal('left'); $format1->fontsize('18'); $format2 = $xml->addstyle('verticaltext_left'); $format2->alignverticaltext(45); $format2->alignhorizontal('left'); $format3 = $xml->addstyle('wraptext_top'); $format3->alignwraptext(); $format3->alignvertical('top'); /** * create new sheet xml document */ $sheet1 = $xml->addsheet('alignment'); /** * add 3 new cells of type string difference alignment values. * notice style of each cell can explicity named or style * reference can passed. */ $sheet1->writestring(1,1,'left_rotate45',$format1); $sheet1->writestring(1,2,'vertical left','verticaltext_left'); $sheet1->writestring(1,3,'this text has been wrapped , aligned @ top','wraptext_top'); $sheet1->writestring(1,4,'no style applied'); $sheet2 = $xml->addsheet('formulas'); /** * wrote 3 numbers. * rows 4 , 5 show formulas in r1c1 notation using writeformula() * function. * see how comments added. */ $sheet2->columnwidth(1,'100'); $sheet2->writestring(1,1,'number'); $sheet2->writenumber(1,2,50); $sheet2->writestring(2,1,'number'); $sheet2->writenumber(2,2,30); $sheet2->writestring(3,1,'number'); $sheet2->writenumber(3,2,20); $sheet2->writestring(4,1,'=sum(r[-3]c:r[-1]c)'); $sheet2->writeformula('number',4,2,'=sum(r[-3]c:r[-1]c)'); $sheet2->addcomment(4,2,'here formula: =sum(r[-3]c:r[-1]c)','my name'); $sheet2->writestring(5,1,'=sum(r1c2:r3c2)'); $sheet2->writeformula('number',5,2,'=sum(r1c1:r3c2)'); $sheet2->addcomment(5,2,'here formula: =sum(r1c1:r3c2)'); $sheet4 = $xml->addsheet('more formatting'); $format4 = $xml->addstyle('my style'); $format4->fontbold(); $format4->fontitalic(); $format4->fontunderline('doubleaccounting'); $format4->bgcolor('black'); $format4->fontcolor('white'); $format4->numberformatdatetime(); $mydate = $sheet4->convertmysqldatetime('2008-02-14 19:30:00'); $sheet4->writedatetime(1,1,$mydate,$format4); // change row1 height 30 pixels $sheet4->rowheight(1,'30'); $sheet4->writestring(2,1,'formatted text + cell color + merged + underlined',$format4); // merge (2,1) 4 columns right , 2 rows down $sheet4->cellmerge(2,1,4,2); exit; /** * send headers, output data */ $xml->sendheaders(); $xml->writedata(); ?>
try following changes:
$xml->writedata(); $xml->writedata([path file]);
if null return xml.
Comments
Post a Comment