Page 1 of 1
php to excel chart?
Posted: Wed Sep 15, 2010 7:29 am
by Marchosius2
Hi all, I am new to this site and hope that some one would be able to help me.
cutting to the chase, i need some way of generating an excel spreadsheet with a dynamic graph from data recieved from a database.
I have been asked to research this.
any one with some advice?
Re: php to excel chart?
Posted: Wed Sep 15, 2010 7:39 am
by buckit
Re: php to excel chart?
Posted: Wed Sep 15, 2010 9:21 am
by Marchosius2
thanx for the reply, through much searching i found a way but not a method.
i have a excel macro that would generate my chart and place my data in. but the method i dont have is to excecute the macro into excel useing php.
any help on this?
Re: php to excel chart?
Posted: Thu Sep 16, 2010 1:43 am
by Marchosius2
Can any one help on this? most of the methods online show how to genirate a image file and place that in excel.
I am looking for a method to send the data to excel and make excel genirate the chart and then let the user download that excel doc.
I know how to write data to excel, and make it download to the user. but how can you make excel genirate the chart?
some methods i have thought of would be to send the macros through php to the excel.
or
make a excel file with the chart already in it and then just update the "template" file?
Re: php to excel chart?
Posted: Thu Sep 16, 2010 7:56 am
by buckit
you are tying to get tomatoes to work with apples. you cant use a scripting language like PHP to control a GUI like excel. the best you could do is use command lines to accomplish your needs... unfortunately excel only has command options (control how it loads and what file to load). You may be able to get something working with the Excel Automation Client. but I have never used it, only know of its existence.
The real question here is why excel and why does the chart need to be generated with a macro? and why excel?
There are TONS of ways to create charts with PHP and even ways of creating excel files with charts. but in terms of using PHP to send data to excel and excel creating a chart, saving the file, and then telling PHP that its ready for download.... I believe you're SOL.
Re: php to excel chart?
Posted: Thu Sep 16, 2010 8:09 am
by VladSun
If it's a Windows server you may try using the Excel COM API ...
http://www.php.net/manual/en/class.com.php
though I've never tried it.
Re: php to excel chart?
Posted: Thu Sep 16, 2010 8:34 am
by Eran
http://phpexcel.codeplex.com/
This can be found by the way, by googling "php excel"