Hi,
I am developing a web application using JSP, servlet in ubuntu. I want to convert a JSP page into PDF. I dont want to store the PDF file in my local drive. Just convert into PDF and view Dynamically while i click a Button.
For Example,
In "index.jsp", i hava 2 Text boxes, one is for from date and another one is for to date. I have one submit button "Generate PDF Report". If i click that button, it will redirect to "report.jsp". In that page, I using the follwing code,
<html>
<table>
<tr>
<td>Roll No</td>
<td>Name</td>
</tr>
<%
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from testtable where fromdate='"+requset.getParameter("fdate")+"' and todate='"+requset.getParameter("tdate")+"'");
while(rs.next())
{
%>
<tr>
<td><%=rs.getString("rno")%></td>
<td><%=rs.getString("name")%></td>
</tr>
<%
}
%>
</table>
</html>
Then the output will be displayed in a PDF page like this,
Roll No Name
1 XXXX
2 YYYY
3 ZZZZ
Any one can help Please....?