Link to home
Start Free TrialLog in
Avatar of popnfresh86
popnfresh86

asked on

Using PHP to create MS Excel Sheets

Hi everyone,
Just needed some help with php. Let me get straight to the point, I need to figure out how to create excel sheets in php so that users who come to my site enter in some info, I thenmake the sheet for them and create a link for them to download the excel sheet. I will also probably need to implement sessions to delete the old excel sheets. Anyways I have no idea how to create excel sheets in php and was wondering if anybody could help me figure out how to do so.

I need to be able to:
1)  enter in specific data into certain fields
2)  format the cells (ie. show as percent instead of decimal)
3)  add styles to specific cells (ie. bg colour, fonts, alignment, etc.)

This site is generally going to be used to help University students create personal Grade calculators where they enter in the number of assignments/tests/reports they have, what mark they recieved in each (blank for those not yet recieved/done), what mark they would like to get. Based on this info the sheet will display what marks they need to get to recieve their desired final and what mark they would get if they get perfect in the unmarked sections. Also it will tell them what their current mark is.

I have already created a template sheet (with formulas) which I am using for my own marks and hope to use that as a guide for my site.
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of compustarsg
compustarsg

one more way is you can create csv (comma seperated)  files using php, which you can open in ms excel. but you cant do formating, coluring etc., may be some way but i dont know.
I found this site where it creates the excel file from a SQL database.
You may want the users to enter in the data save it to the SQL database and then generate the spead sheet and prompt the user to download.

This url shows you how to create a excel spread sheet from a SQL database.

http://www.stargeek.com/php_scripts.php?script=2&PHPSESSID=abddb1bbe251144cf84109b93ea06ed1
Avatar of popnfresh86

ASKER

Thanks for the suggestions. hernst42 gets the points cuz it was more of what i was looking for. Thanks again.