0

i have been reading around looking for a way to get graphs and so on into my spread sheet i export out of my database and to make it look better for my employee who wants reports of everything in a certain way and so on. I have found PhpExcel.. which seems really good it can do everything i want it to plus more.. but i haven't been able to work out how to use data from my mysql table to fill in the cells since it seems like they all have to be manually set to a value...

i have read over this post How to set cell value Dynamically i have attempted to use the code provided in this page to try and help me out but i havent been able to get it to work for some reason i am always receiving an error.

i am hoping someone may be able to help me out with trying to get this MySQL table data into a spreadsheet using php excel or even if there are any other links i may have missed i would really appreciate it...

4

3 回答 3

0

我正在用 PHPExcel 做很多工作......我写了一个小类来简化导出,你可以在这里下载

您只需要将数据库中的数据放入数组中,将其传递给此类并指定输出格式。我希望它有所帮助。

于 2012-06-12T23:01:01.787 回答
0

I have done this using the PEAR classes for PHP. You can read the data from the MYSQL database and then write the script using the PHP and PEAR classes to create an excel file for the same.

Here is link to the SpreadSheet Writer

This tutorial will help you to install PEAR and write the data to the excel sheet.

Hope this will solve the problem you are facing.

于 2012-05-24T06:40:22.343 回答
0

如果您安装phpmyadmin以连接到您的数据库。

然后,您可以为所需的任何报告编写 SQL 查询。

并将结果导出(参见图 1)到 CSV 或 MS Excel 的 CSV(参见图 2)。

查询结果下方的导出选项 在此处输入图像描述

选择导出数据格式 在此处输入图像描述

于 2012-05-24T06:07:34.647 回答