www.webdeveloper.com
Results 1 to 4 of 4

Thread: exporting table data to a CSV file

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    exporting table data to a CSV file

    hello all,
    i have a data table on my webpage. and i have one "Export" button just above it. now when the user clicks on the "Export" button, i want the current table data to be exported to a CSV (Comma Separated Values) file. how this can be done in javascript? does anyone have some sample code available for this?
    Thanks in Advance!!

  2. #2
    Join Date
    Dec 2005
    Posts
    55
    This can't be done in Javascript because you need to make a connection with the database, and you are already fetching the data from the database for your display table
    This can be done in PHP though.
    "Just smile and wave boys; smile and wave"

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    No. Javascript is a client-side language, thus it can not create/write files. You might use AJAX to send data to the server (or simply submit data in classical way), where a server-side application (php, asp...) will do that transform job.

  4. #4
    Join Date
    Apr 2006
    Posts
    2
    On my webpage i have a div element which again has 2 div elements. the first div shows table header and the second one displays table data. how can i submit that much data only without affecting the rest of the page with Ajax?
    i suppose, i need to use "out.println()" in order to create the .csv file using jsp.
    Any help?
    thanks a lot!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles