nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   Software Development (http://www.nvnews.net/vbulletin/forumdisplay.php?f=53)
-   -   MySQL Export to XLS using Classic ASP (http://www.nvnews.net/vbulletin/showthread.php?t=105314)

technoid 12-30-07 03:27 PM

MySQL Export to XLS using Classic ASP
 
I wrote an export function to create a CSV file but it would be nice to be able to create a Real XLS file too. I've looked around a lot but haven't found any good example code to do it. I'm using Classic ASP so if you know where I can get something to help me I'd appreciate the information.

I'm running MySQL on a Windows 2000 Server at work using Classic ASP to write the webpages with. I'd use something better if I knew how :)

I installed PHP on my home system running XP Pro and IIS and could install PHP at work too if necessary to get the XLS working. I did find some PHP sample code to create a real XLS file but it's very bare bones and you can't do any formatting. But it does seem to create a real XLS file since Excel will open it without complaining and it's in a binary format. I could use that or port it over to ASP but since it's so bare bones a CSV file seems as good.

I guess I could ask another question too. At work on the Windows 2000 Server I have a SATA RAID using an Adaptec 1200A and anytime I try to put the MySQL data directory on the RAID Array it takes down the RAID after about 45 minutes of just sitting there looking like it's looked up. So I have the MySQL data directory on the OS drive, not a good solution. If anyone has any information about that problem I'd love to hear that too.

Thanks for any help.

fivefeet8 12-31-07 12:15 PM

Re: MySQL Export to XLS using Classic ASP
 
The PEAR repository does have an Excel generation package for PHP.

http://pear.php.net/package/Spreadsheet_Excel_Writer/

It generates native Excel files and has numerous functions for formatting. It's programmed in PHP, it's free, and has good documentation. You'll need to program the exporting part yourself, but once you've gotten the data from the Mysql database, creating the excel sheet and formatting is pretty straightforward.

I've actually used it on a production site that the company I work for uses to generate quarterly reports in Excel.

technoid 01-01-08 03:52 PM

Re: MySQL Export to XLS using Classic ASP
 
Quote:

Originally Posted by fivefeet8
The PEAR repository does have an Excel generation package for PHP.

http://pear.php.net/package/Spreadsheet_Excel_Writer/

It generates native Excel files and has numerous functions for formatting. It's programmed in PHP, it's free, and has good documentation. You'll need to program the exporting part yourself, but once you've gotten the data from the Mysql database, creating the excel sheet and formatting is pretty straightforward.

I've actually used it on a production site that the company I work for uses to generate quarterly reports in Excel.

Very Cool... I'm off to get it now, Thanks :)


All times are GMT -5. The time now is 02:31 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.