I have a page which has a Table which has details like name , password , address , telephone number etc...
Now this is displayed from the database nicely as i want to. Now i have a button saying EXPORT to .txt , Whatever data it shows on the Jsp i.e name,, password , address , telephone number etc on click of that button should popup an option to the user giving him / her an option to save the data as .txt file. I have tried response.setContentType(text/plain) and setting the header to .txt button , the file which is opening is outputting the source of the html page then the output which i am desiring i.e name , username etc.
Can someone please show me the light on how this can be achieved. Previously it was application/vnd.ms-excel and it used to save in excel , but now the users need it into a .txt rather then .xls.
Any help is much appreciated.
Thanks in advance.
Yogendra N Joshi
Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Hello thanks for the code, I have tried to put it.
It giving an exception saying method getFileByteArrayOutputStream(); cannot be resolved to a type. I have seen the API for ByteArrayOutputStream but didn't get any fruits out of it.
The Current code is :
For the extension which we are using right now . i.e doc , its coming very perfectly. Also if the extension is .xls then its coming fine. Only for .txt it is giving problems. Can you please give us more idea on this ?