Hi Paul Clapham,
Yes you are right my problem was related to JS only but to fix this issue i am trying to get data from HTML using JSP.
I have implemented solution as well thanks to all for kind support.
Please find details below :
Question 1: What was the problem?
Ans: Problem was related to executeCommand function which is not working with any of the browsers except internet explorer 6.
Question 2: What was the approach to fix this issue?
ans : Earlier data is writing in CSV using executeCommand but it was only for internet explorer 6,I have fixed this issue with all of the browsers using JSP.
I have written one independent jsp and one new function in JS to call this JSP.Now i am able to get and write data in CSV with all browsers.
Please find JSP code below :
<%
String csvFileContain = request.getParameter("csvData");
csvFileContain=csvFileContain.replaceAll("\"\"", "\",\"");
//System.out.println(csvFileContain);
response.setContentType("text/csv");
//response.setContentType("text/html");
String disposition = "attachment; fileName=data.csv";
response.setHeader("Content-Disposition", disposition);
out.clear();
out.write(csvFileContain);
out.flush();
%>