Anybody ever do this???
PHP/Oracle need code to Export a resulted query to Excel.
Moderator: General Moderators
PHP/Oracle need code to Export a resulted query to Excel.
Currently we are displaying the result of an ORACLE query on a php page. We would like to export the results of that stored query to an excel spreadsheet with the touch of a button/link.
Anybody ever do this???
Anybody ever do this???
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Code: Select all
<?php
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
?>help!!!!!!!
Is there anyone out there that knows how this works??? 
You can get classes that will allow you to create excel spreadsheets. Look at PEAR for a decent one.
Usually, I just export as a comma separated file, then import it into Excel. As cool as making an Excel spreadsheet is, it's quite a bugbear to get working flawlessly (in my experience).
Usually, I just export as a comma separated file, then import it into Excel. As cool as making an Excel spreadsheet is, it's quite a bugbear to get working flawlessly (in my experience).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
As said, there is alot of premade classes for this (why reinvent the wheel?). I've used BiffWriter briefly once, and it worked well.pickle wrote:You can get classes that will allow you to create excel spreadsheets. Look at PEAR for a decent one.
Usually, I just export as a comma separated file, then import it into Excel. As cool as making an Excel spreadsheet is, it's quite a bugbear to get working flawlessly (in my experience).
I am not having any luck with these suggestions. I may be utilizing them incorrectly.
The situation again is...I already have a saved query displaying on a results page, I just want the php code to insert into my code that will allow me to export that query into a spreadsheet, cvs, xls, anything. Please help.
The situation again is...I already have a saved query displaying on a results page, I just want the php code to insert into my code that will allow me to export that query into a spreadsheet, cvs, xls, anything. Please help.