News Feed

News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Generate Excel Files and Charts with PHPExcel
September 11, 2014 @ 09:48:55

SitePoint's PHP blog has a new post that walks you through the creation of Excel files with the help of the PHPExcel tool, a part of the overall PHPOffice package.

After my article "How To Make Microsoft Word Documents with PHP" (using Interop capability under Windows), there were quite a few comments urging a pure PHP implementation, i.e., only using a universal PHP library to manipulate Office files. In this article, we will see how to use a PHPExcel library to provide an "Export to Excel" function in a web app so that the user can export the data into an Excel 2007/2013 file for further analysis.

His example spreadsheet shows game information for an NBA team (the LA Lakers) including some charting and analytic data in the exported output. He sets up a simple Silex application and both a base and export endpoints. He also shows you how to create the PHPExcel instance, configure it with properties like creator, title and a set of keywords. With this object in place he moves into setting data for each of the rows/cells, populating it from a database table. He also includes examples of creating more than one sheet of results, inserting formulas and creating the charts mentioned earlier.

0 comments voice your opinion now!
phpexcel tutorial excel microsoft chart formular export

How to Generate a Complete Excel Spreadsheet From MySQL
November 23, 2011 @ 17:52:54

On NetTuts there's a new tutorial showing how to take data from a MySQL database and translate it into a usable Excel file with the help of some simple PHP.

A CSV (Comma Separated Value) file is usually sufficient for exporting MySQL data as an Excel Spreadsheet. These CSV files are data only though. A real Excel spreadsheet has formatting, formulas and perhaps even graphics - the difference between a simple method of data transfer and a professional report. This tutorial shows how to use open source PHP components to create "real" Excel spreadsheets from MySQL SELECT statements.

With the help of the PHPExcel tool, making Excel-formatted files is a simple process. They show how to label columns, pull data out with a "quick and dirty" SQL statement, formatting the results to something a bit more clean and iterate through the pages of data to push them into the spreadsheet (including formulas). You can download the full source to get everything in one shot.

0 comments voice your opinion now!
excel spreadsheet tutorial phpexcel mysql database

Ilia Alshanetsky's Blog:
PHP Excel Extension
August 02, 2010 @ 13:12:02

In a new post to his blog today Ilia Alshanetsky talks about a PHP Excel extension to help with some output generation problems he was seeing (based on the LibXL libraries).

As we are doing more & more Excel output generation, this became a bigger and bigger problem. At first we've tried solving the problem via a newer PHP based Excel library, PHPExcel. Unfortunately, it is massive beast, that is not only slower than the old Spreadsheet Excel Writer/Reader, but memory hog too. [...] So, I turned to Google and found LibXL, which is a small, C++ (with C, C++ interfaces) library that promised really fast Excel reading & writing.

His extension gives you an object-oriented interface to the library that can generate Excel files with a lot less resources than some of the other PHP Excel extensions out there. He includes a sample benchmarking script he used to generate these stats.

0 comments voice your opinion now!
excel extension libxl phpexcel github
Import and export data using PHPExcel
July 15, 2010 @ 10:21:12

On the ThinkPHP blog today there's a new post looking at their experience with PHPExcel to open, modify, save, etc Microsoft Excel files directly from PHP.

EAR's Spreadsheet_Excel_Writer combined with the project Spreadsheet_Excel_Reader on SourceForge was a good helper in the past - but only for BIFF5. BIFF8 support in spreadsheet excel writer has been a problem for a long time, and according to the authors, is still somewhat kludgy in the current version. So I needed an alternative. After a short research I stumbled upon PHPExcel which supports reading and writing of many formats in one API.

He lists some of these input and output formats and includes a simple example of how to use the tool. He creates a basic Excel file with a few different attributes (title, body, keywords) and show how to read in a document to extract the document's content.

0 comments voice your opinion now!
import phpexcel export tutorial excel microsoft

Maarten Balliauw's Blog:
Saving a PHPExcel spreadsheet to Google Documents
February 03, 2009 @ 12:58:56

Maarten Balliauw has written up a guide to saving the output of your PHPExcel applications out to the Documents service that Google offers.

As you may know, PHPExcel is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file. Currently, PHPExcel supports writers for Excel2007, Excel5 (Excel 97+), CSV, HTML and PDF. Wouldnt it be nice if we could use PHPExcel to store a spreadsheet on Google Documents? Let's combine some technologies.

The two technologies in question are a standard install of the PHPExcel library and the Zend Framework (with its Zend_Gdata component). Using the component, a save() method is created and hooked into the IWriter interface of PHPExcel. When this save method is called, the Zend_Gdata component connects to the Documents service and uploads the resulting information for the account you supply.

0 comments voice your opinion now!
tutorial save phpexcel extensible document google spreadsheet zendframework zendgdata

Maarten Balliauw's Blog:
Reuse Excel business logic with PHPExcel
May 06, 2008 @ 07:51:38

Maarten Balliauw has made a new blog post today about a method he's using to help reuse some of the business logic that Excel spreadsheets can have in a PHP script with help from PHPExcel.

In many companies, business logic resides in Excel. This business logic is sometimes created by business analysts and sometimes by business users who want to automate parts of their everyday job using Excel. [...] Did you know you can use PHPExcel to take advantage of the Excel-based business logic without having to worry about duplicate business logic?

He creates a quick example of a script that can take in an Excal file and pull it into a PHPExcel object, ready for manipulation. He fills in values for the already defined fields (like "carColor" or "leatherSeats") and uses the getCalculatedValue method to perform the action on the cell. The output is dropped into a variable that can be echoed out or used later on in the PHP script.

0 comments voice your opinion now!
phpexcel excel business logic reuse tutorial example

International PHP Magazine:
Poll Question Which is the Best Feature for PHPExcel Version 1.0.0?
March 28, 2007 @ 14:32:11

The International PHP Magazine has posted the results of their latest poll conducted over the past week. They asked developers which of the given options was the best feature of the version 1 release of PHPExcel.

Options for this week's poll included "Creating an in-memory spreadsheet representation", "Adding Worksheets to Spreadsheet", and "Setting Spreadsheet Meta Data", but in the end, it was the "None" option that won out with almost thirty percent of the votes. Tied for second, each with 2.4% of the votes were the options "Creating an in-memory spreadsheet representation", "Setting Spreadsheet Meta Data", and "Adding Worksheets to Spreadsheet".

If you'd like to get in on the action for this week's poll, check out the question and answers for the week - which one of the options is your favorite CMS written in PHP. (Options include Drupal, Joomla, and the Dragonfly CMS).

0 comments voice your opinion now!
phpexcel feature poll favorite cms joomla drupal phpexcel feature poll favorite cms joomla drupal

International PHP Magazine:
Poll Question What are the Features you want to see in PHPUnit Projects
March 21, 2007 @ 09:49:00

The International PHP Magazine has posted their latest results from this past week's poll. They asked readers to vote on which of the options they wanted most to see in PHPUnit projects.

Tying for first place were the two open-ended options, "All" and "None" - both with 17.8% percent of the votes. Falling down to the next slot was the "Web interface for Test Result Database" option, followed by "Support for Distributed Testing".

Be sure to cast your vote in this week's poll too. They ask you, the reader, to vote which of the features listed is the best that the PHPExcel package has to offer (including "Setting Spreadsheet Meta Data" and "Adding Images to your Spreadsheet").

0 comments voice your opinion now!
weeklypoll phpunit project feature phpexcel package weeklypoll phpunit project feature phpexcel package

Community Events

Don't see your event here?
Let us know!

symfony zendserver language conference list interview introduction tips release deployment series api bugfix framework podcast laravel threedevsandamaybe code community voicesoftheelephpant

All content copyright, 2014 :: - Powered by the Solar PHP Framework