This project allows PHP programmers to export data into Excel workbook. You can create multiple sheets, use fonts, colors and borders. Exported data is in XML format, recognized by Microsoft Office Excel
Be the first to post a text review of PHP to Excel. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Some checks added to limit sheet size to 65535 by 255 cells
- function SetAuthor($author) Set the author's name in document - function SetCompany($company) Set the company name in document - function Open() Begin document. Not really big deal, just set the status as open - function NewStyle($name) Defines a new style if not existing and set it as the current one. If style exists, returns 0. - function CopyStyle($source,$destination) If the source style exists, it is copied in the destination style and set as the current style. Otherwise return 0 - function SetActiveStyle($style) Sets as current style the style passed as agument. If the style doesn't exist, nothing is done and returns 0. - function StyleSetBackground($color='#FFFFFF', $pattern='Solid') Set the background collor and fill style to the current style - function StyleSetFont($fontname=0, $size=0, $color=0, $bold=0, $italic=0, $underline=0) Set the font parameters to the current style Note: - underline can be 0-no underline; 1-one underline; 2-double underlines - bold, italic 0-unset; 1-set - function StyleSetAlignment($horizontal, $vertical=0) Set the alignment to the current style Note: - values can be -1 -left/top; 0 -center; 1-right/bottom; or names - function StyleAddBorder($position, $color='#000000', $thick=1, $style='Continuous') Ads a border to the current style. Position can be one of "Bottom","Left", "Right","Top","DiagonalLeft","DiagonalRight" and the thicness less than 4 - function AddSheet($name='Sheet') Start a new Worksheet with the name provided - function SetColWidth($col, $width) Set column Width in pixels - function SetRowHeight($row, $height) Set column Height in pixels - function Cell($row, $col, $data='', $type='String') Write data to the cell. row must be less than 65535 and col less than 255. Type can be one of: String or Number - function Text($row, $col, $txt) Alias to Cell with type set to String - function Number($row, $col, $num) Alias to Cell with type set to Number - function Close() Close document and generate internal buffer data to be exported - function Output($name='') Output XLS from internal buffer to browser as download file with the name provided - function Error($msg) Stops the execution of the script and dumps a message
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?