Solved

Generating Excel in php

Posted on 2013-11-07
2
279 Views
Last Modified: 2013-11-07
I am accustomed to generating Excel spreadsheets in php programs using

header("Content-type: application/vnd.ms-excel");
$fn = "excel" . date('Y-m-d_h_i') . ".xls";
header("Content-Disposition: attachment; filename=" . $fn);

I now have a customer that wants excel formulas in cells, etc.

I'm guessing that when I understand the details of the formulas, I can just print those formulas in the appropriates cells; like sum(G4:G67), etc.

There is apparently a Ruby on Rails Gem that does all this.

https://rubygems.org/gems/axlsx

Is there anything comparable in php?
0
Comment
Question by:Richard Korts
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39632137
PHPExcel has all the classes for you including adding formulae to cells

http://phpexcel.codeplex.com/

Would be a lot easier than writing up all your own code.
0
 

Author Closing Comment

by:Richard Korts
ID: 39632166
Great.

Look for my next question about YAML.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question