Results 1 to 4 of 4
  1. #1
    nida is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default Export csv in servlets

    Hi,
    i want to export data from database to csv file csv , which i have created successfully, but now i want to display a dialogue for taking input of filename and path and on the save button of dialogue (in jsp),i want to call my survlet controller;

    can any one help me out??

    Thanks
    Last edited by nida; 05-22-2009 at 09:38 AM.

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    837
    Rep Power
    6

    Default

    Hi Nida,
    You can embed javascript and take the filename and filepath from the dialog and pass it to servlet as parameter values.

    Ex:
    var filename= prompt('Please enter your file name', ' ');
    var filepath= prompt('Please enter your file path', ' ');
    document.location.href = "servletpath?filename="+filename+"&filepath="+file path;
    Ramya:cool:

  3. #3
    nida is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default Export Csv file with Save As dialogue

    Thanks Ramya it really helped me out..and cvs file is exported :).. is there any way to display prompt for user to select the file path/location instead of given by the user ,Before that i have used "document.execCommand('SaveAs',1,filename);" but i was facing some issues like, there was no option for .csv file in file type and secondly the calling of servlet controller on save button of dialogue ..

    Thanks.

  4. #4
    nida is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default

    hi again,
    My problem of getting filename and path from dialog box is fixed , i have used FileDialogue , get filename ad directory and then call my Servlet controller, Thaaaaanx for all the ppl who considered my quries and guided me..:)
    Thanx.

Similar Threads

  1. Export data to xls
    By trill in forum Advanced Java
    Replies: 5
    Last Post: 03-24-2011, 05:13 AM
  2. Export to excel
    By nehaa in forum AWT / Swing
    Replies: 1
    Last Post: 04-30-2009, 02:44 PM
  3. export to excel
    By diana glz in forum Advanced Java
    Replies: 0
    Last Post: 03-13-2008, 11:01 PM
  4. export to excel
    By diana glz in forum New To Java
    Replies: 0
    Last Post: 03-13-2008, 09:26 PM
  5. Export excel issue
    By sanjay_sharma77 in forum Advanced Java
    Replies: 0
    Last Post: 01-10-2008, 03:47 PM

Posting Permissions

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