Results 1 to 4 of 4
Thread: Export csv in servlets
- 05-22-2009, 09:31 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 14
- Rep Power
- 0
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??
ThanksLast edited by nida; 05-22-2009 at 09:38 AM.
- 05-22-2009, 11:13 AM #2
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:
- 05-23-2009, 10:10 AM #3
Member
- Join Date
- Mar 2009
- Posts
- 14
- Rep Power
- 0
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.
- 05-25-2009, 07:03 PM #4
Member
- Join Date
- Mar 2009
- Posts
- 14
- Rep Power
- 0
Similar Threads
-
Export data to xls
By trill in forum Advanced JavaReplies: 5Last Post: 03-24-2011, 05:13 AM -
Export to excel
By nehaa in forum AWT / SwingReplies: 1Last Post: 04-30-2009, 02:44 PM -
export to excel
By diana glz in forum Advanced JavaReplies: 0Last Post: 03-13-2008, 11:01 PM -
export to excel
By diana glz in forum New To JavaReplies: 0Last Post: 03-13-2008, 09:26 PM -
Export excel issue
By sanjay_sharma77 in forum Advanced JavaReplies: 0Last Post: 01-10-2008, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks