Forum Moderators: coopster

Message Too Old, No Replies

Convert data to MS Excel

         

tonynoriega

3:26 pm on Feb 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i have a php page that is a simple query form for my agents.

they query records over a given time span and it displays the corresponding data.

now they want to be able to take that data and have it export into an excel spreadsheet...

uhhh? can i do this? i tried to Google it and no good leads...

jatar_k

3:41 pm on Feb 12, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



export it as csv and leave the rest up to them

Generating a CSV for Download from MySQL [webmasterworld.com]

tonynoriega

10:00 pm on Feb 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jatar_k

on my page the users have to select a beginning date and and end date to query.

how can i use your example to say, put into a link?
i.e.

<a href="export.php">Generate CSV File</a>

after the records are displayed...?

and throw your example into a function...

willybfriendly

10:14 pm on Feb 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From later in that same thread...

it creates the file for download only and prompts with an 'open/save as' dialog.

Use something like a drop down list (or a calendar script) to create your query. Modify the script to use the data from your page to construct the query and you should end up with happy customers.

jatar_k

12:37 am on Feb 14, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



or take whatever they selected and throw it into the link to be used by the query

<a href="export.php?start=1&end=2">Generate CSV File</a>