Current location: Hot Scripts Forums » Programming Languages » PHP » export reports as .csv file in browsers computer


export reports as .csv file in browsers computer

Reply
  #1 (permalink)  
Old 12-22-09, 12:12 AM
rsmahaa rsmahaa is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
export reports as .csv file in browsers computer

Hi all,

I had generated backend reports as tables. now i have to give the option to export that table. Already im using manual code to export data as .csv file . But the pbm is, this report is getting stored in server itself ( same folder where the code is). but i need some code to save file in client (user )mechine.
some one plz help.
Reply With Quote
  #2 (permalink)  
Old 12-22-09, 06:43 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
You should be able to just present the user with a link to the .CSV file. They can use the browser to decide whether to view it or save it.

You can't (shouldn't) place content on client computers without user interaction, this is for security.
Reply With Quote
  #3 (permalink)  
Old 12-22-09, 06:46 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
You can use this script (with minor modifications) to export to a CSV file:

PHP Code: Export table to Excel or MS Word file - Export a mySQL database table to an EXCEL file.

Quote:
Originally Posted by rsmahaa View Post
I had generated backend reports as tables. now i have to give the option to export that table. Already im using manual code to export data as .csv file . But the pbm is, this report is getting stored in server itself ( same folder where the code is). but i need some code to save file in client (user )mechine.
some one plz help.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello all, can you help me? K4ot1K Other Languages 2 01-23-09 05:23 AM
Anyone willing to help a programmer in trouble? PAID JOB! aXXo Job Offers & Assistance 1 08-26-08 12:59 AM
Checking a file exists lee PHP 3 04-23-06 12:44 AM
Export to excel file asp traceMe ASP 2 08-01-04 09:07 PM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM


All times are GMT -5. The time now is 08:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.