Couldn't Get The Values From Jsp To Servlet
If I run jsp, while exporting the contents to excel, I am not getting the values in downloaded excel file. It is simply empty. Here what I tried.. How to pass the table values to s
Solution 1:
Try this:
<%@ page language="java" contentType="application/vnd.ms-excel"
pageEncoding="ISO-8859-1"%>
<%@ page import ="javax.swing.JOptionPane"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Export to Excel - Demo</title>
</head>
<body>
<table align="left" border="2">
<thead>
<tr bgcolor="lightgreen">
<th>Sr. No.</th>
<th>Text Data</th>
<th>Number Data</th>
</tr>
</thead>
<tbody>
<%
for (int i = 0; i < 10; i++) {
%>
<tr bgcolor="lightblue">
<td align="center"><%=i + 1%></td>
<td align="center">This is text data <%=i%></td>
<td align="center"><%=i * i%></td>
</tr>
<%
}
%>
</tbody>
</table>
<p>
fsfndfkdsfdkfjsfksfskfsfskfsfksfskf
dfkdjfkfksfkkkkkkkkkjjjjjjjjj
</p>
<a href="Sample?exportToExcel=YES">Export to Excel</a>
Post a Comment for "Couldn't Get The Values From Jsp To Servlet"