I have a JSP cantian, Header,footer and a HTML table which is dynamically generated from the previous page. I am trying to export that HTML table data to a EXCEL sheet.
I placed the above code in my JSP. Its generating Excel sheet with Header, table, and Footer(but its not showing the result page).
But My application needs, After displaying the result page(Result page cantains Header, Footer and HTML table) , I have a link "Export to Excel" . Once I click that link it should generate a Excel sheet with only HTML Table contents.(Not with all) Is there any speicfic way to do that. Please suggest me some way.
JSP page only contains one HTML table with 6 columns, lets say (column1,2,3,4,5,6), I placed a hyperlink to column1 to show the deaials of that record(Table contains 100's of records).
I need to place a button at the bottom of the table "EXPORT TO EXCEL". When I click that button, The data in the HTML Table(100's of records )should export to EXCEL sheet without reloding the page and user be able to save that excel sheet.
Once user saved the excel sheet, then if he wants to view the record details then he will click on the hyperlink(column 1) and view the details.
how to achieve this functionality EXPORT TO EXCEL with button? Please suggest me. -Mark
you can create a jsp file export_to_excel.jsp and set the response like: response.setContentType("application/vnd.ms-excel"); response.setHeader("Pragma", "public"); response.setHeader("Cache-Control", "max-age=0");
upon clicking the button, you will see a dialogue box asking to save or display ... that will be self explainatory!