I wanted to know if there is a way in which I can pass an HTML table from my JSP page using the Java request object.
More precisely, this is what my table looks like..
table id="tableid"
thead
tr
th...column1 header.../td
th...column2 header.../td
/tr
/thead
tbody
tr
td...column1 data../td
td..column2 data../td
/tr
/tbody
/table
I've a method in my Java code getExcelVersion(), for which I wanted to pass the above table as an argument.
I actually wanted to pass data from the table(column1 data, column2 data) as an List, ArrayList or anything data type, and not the actual HTML. What I'm basically trying to achieve is something as follows:
I've an HTML table, that I need to export to excel on a button click. For this purpose, I'm using libraries from Apache-POI, and the foll. code block.
HSSFWorkbook workbook = getExcelVersion();
resp.setContentType("application/vnd.ms-excel");
resp.setHeader("Content-Disposition", "attachment; filename=\"contacts.xls\""); workbook.write(resp.getOutputStream());
resp.flushBuffer();
Now, I wanted to know how would I pass table data(column1 data, column2 data) to my getExcelVersion() method.
Thanks,
Pritish.