Solved

Generating Excel in php

Posted on 2013-11-07
2
278 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
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 …

776 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