Home Answers Viewqa JSP-Servlet query regarding exporting table from jsp page to pdf

 
 


Rashmi Joshi
query regarding exporting table from jsp page to pdf
1 Answer(s)      a year and 2 months ago
Posted in : JSP-Servlet

hello

i am displaying one table on my jsp page and i want to save that table in pdf file can u please help me???

please reply as soon as possible

View Answers

March 28, 2012 at 5:33 PM


1)createPDF.jsp

<html>
        <form name="form" method="post" action="pdf.jsp">
        <table border="1">
        <tr><td>Name</td><td>Address</td></tr>
         <tr><td><input type="text" name="name"></td><td><input type="text" name="address"></td></tr>
         <tr><td><input type="text" name="name"></td><td><input type="text" name="address"></td></tr>
         <tr><td><input type="text" name="name"></td><td><input type="text" name="address"></td></tr>
         <tr><td><input type="text" name="name"></td><td><input type="text" name="address"></td></tr>

        </table>
        <input type="submit" value="Submit">
        </form>
</html>

2)pdfTable.jsp:

<%@page import="java.io.*"%>
<%@page import="com.lowagie.text.*"%>
<%@page import="com.lowagie.text.pdf.*"%>

<%
       String name[]=request.getParameterValues("name");
       String address[]=request.getParameterValues("address");
       try{
       Document document=new Document();
       PdfWriter.getInstance(document,new FileOutputStream("C:/data.pdf"));
       document.open();
       PdfPTable table=new PdfPTable(2);
       table.addCell("Name");
       table.addCell("Address");
       for(int i=0;i<name.length;i++){
       table.addCell(name[i]);
       table.addCell(addres[i]);
       }
       document.add(table);
       document.close();
       }
       catch(Exception e){}
  %>









Related Pages:
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
query regarding exporting table from jsp page to pdf
query regarding exporting table from jsp page to pdf  hello i am displaying one table on my jsp page and i want to save that table in pdf file can u...; <table border="1"> <tr><td>Name</td><
Query regarding JSP, JDBC
Query regarding JSP, JDBC  I have a table in SQL Server database storing some ids and names. In my jsp code a while loop is displaying the list of names from the database as links. I want that on click of a link of name furthur
regarding the pdf table using itext
regarding the pdf table using itext  if table exceeds the maximum width of the page how to manage
query regarding arraylist
query regarding arraylist  i m using sql server + jsp to develop my program. i have a problem of fetching data from the table in database. i m storing my keys in arraylist, now i want to get data according to that keys. keys
Wrong parameter values while exporting data from jsp to excel
Wrong parameter values while exporting data from jsp to excel   This is a jsp report. When i export the report data to an excel, the parameter.... This is the my jsp code - <%@ page contentType="text/html;charset=windows-1252
How to set the pdfptable as pdf page header when generating the pdf from jsp page. - JSP-Servlet
How to set the pdfptable as pdf page header when generating the pdf from jsp page.  how to set the pdfptable column headers as a header of the documet.i need to display the column headers for every pdf page if pdf documt is 20
open pdf file in same jsp page and the pdf file should retrieved from database
open pdf file in same jsp page and the pdf file should retrieved from database  Hai all, I need code to open a pdf file in same jsp page(browser) while click on hyperlink And the file was located in database table. Can any
pdf generate from jsp
pdf generate from jsp  how do i generate a pdf using jsp that should query the data from the database and write it into a pdf and download the same
query
in jsp   We are providing you the code where we have specified only three...;%@page import="java.sql.*"%> <form name=myname method=post action="delete.jsp"> <table border="1"> <tr><td></td> <td><b>
Query regarding JSP, JDBC
Query regarding JSP, JDBC  can I get the code for the question asked by me regarding JSP,JDBC
Exporting data from mysql to csv file
Exporting data from mysql to csv file  Hi friends.... I want to export the data from mysql to csv file... i am having 30 columns in my database.. Eg... example that retrieves the data from the database and save it into csv file
Generate unicode malayalam PDF from JSP
Generate unicode malayalam PDF from JSP   Hi, I want to generate a malayalam report in PDF format.I have generated a report in jsp.Now I want... a simple pdf generator code using itext api. Try this: <%@page import="java.io.
exporting data to excel sheet - JDBC
exporting data to excel sheet  Sir i have already send request about... query in java swing program,i want to print the result about the query in excel...); final JTable table = new JTable(model); JScrollPane pane=new
regarding-update the Jsp page itself - JSP-Servlet
regarding-update the Jsp page itself   Joined: Aug 17, 2009 Messages: 12 [Post New]posted Today 10:39:52 PM Quote Edit [Up] I have two Jsp... is i want to update the information on same Jsp page. How can I implement
regarding JSP - JSP-Servlet
regarding JSP  Hi, This is Malleswari from Satyam. I'm facing a problem while running the JSP tags...like if i want to write or any other, the tag is not supported in my page. In prefix i mentioned "c". still i didnt get
generate pdf using jsp
generate pdf using jsp  how do i generate a pdf using jsp that should query the data from the database and write it into a pdf and download the same
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet
how to add the scrollbar to the pdf page when generating the pdf file from jsp  I am not able to see all the columns when i generated the pdf file from jsp.i have 12 colums so how to add the scrollbar
Query regarding hashmap
Query regarding hashmap  I want to store some names and ids in hashmap in session, then retrieve it on next page and iterate through ids to run a query using ids one at a time
Regarding JSP code
Regarding JSP code   hello sir tell me the way to navigate different type of user like manager and client from same login page to different... cant be able to write the code for navigate different users from same login page
Exporting data from mysql into csv using jsp
Exporting data from mysql into csv using jsp  Hi friends.... I want to export the data from mysql to csv file using... i am having 30 columns in my... want csv file with 10 rows.. i want to do in jsp... pls help me soon..its very
query regarding multiple select
query regarding multiple select  i have a select in jsp with multiple options.When i select multiple values i am not able to insert it into database and how do i retrieve them..please help me with an example code
how do i provide down a pdf document fecility on my web page using jsp and servlets?
how do i provide down a pdf document fecility on my web page using jsp and servlets?  Hai, I need a program to provide download option for pdf file on my web page,the pdf file contains retrieved data from mysql table. I need
how to generate the pdf report from jsp
how to generate the pdf report from jsp  <%@page import... want to generate the pdf file from jsp page.I add the itext.jar to the libraries... not getting the pdf file.Any one please help me asap.Its very important
query problem
query problem  how write query in jsp based on mysql table field? i have employee table it contain designation field, how write query in jsp... to write this query in jsp please anybody help me, and send me that code
The type Font is ambiguous where generating pdf file from jsp page - JSP-Servlet
The type Font is ambiguous where generating pdf file from jsp page  I am geeting ambiguous error .Do u want to add any jar files   Hi Friend, Import the class Font into your JSP page like the following
how to give link from jsp to jsp page
how to give link from jsp to jsp page  hi this is my following code...,password); String query = "select * from employee"; st = con.createStatement...:3306/test", "root", "root"); String query = "select * from employee where id
how to give link from jsp to jsp page
how to give link from jsp to jsp page  hi this is my following code...,password); String query = "select * from employee"; st = con.createStatement...:3306/test", "root", "root"); String query = "select * from employee where id
Regarding tiles and struts - Struts
Regarding tiles and struts  Hi, i have a struts application which uses tiles my problem is when i am redirecting/forwarding from a jsp page(which is a tiles page) i am not able to redirect properly it was showing response 
The type Font is ambiguous where generating pdf file from jsp page - JSP-Servlet
The type Font is ambiguous where generating pdf file from jsp page  i am getting the type font is ambiguous and type imgae ambiguous ? document.open(); 32: Font headFont = FontFactory.getFont(FontFactory.HELVETICA
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp  Hello, I am doing web... table. So my question is ,I want so save this html format data in pdf/excel format... can save html table data in pdf/excel format.Your inputs are valuable to me
how to load a table of data from oracle, to a jsp page using hashmap.
how to load a table of data from oracle, to a jsp page using hashmap.  I have a jsp page which ask for project ID,team name,member name according to this data i have to retrieve their details from the database(oracle). I have
creating instance of table in jsp
; 1)i write a code in jsp to retrieve the data from database. 2)the out put file is obviously a jsp page and shows the output in table manner. 3) now i want... it into html table. <%@page import="java.sql.*"%> <table border=1
include a delete option in every row of table in a JSP page
include a delete option in every row of table in a JSP page  I have the following code of a JSP page........... <blockquote> <p>&lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> &lt
How to generate pdf file on click of the links using jsp..
How to generate pdf file on click of the links using jsp..  How to generate the pdf file using jsp file. Generate table in pdf by using jsp.   Here is an example that will generate a pdf file into c drive.The pdf file
how to display values from database into table using jsp
how to display values from database into table using jsp  I want to display values from database into table based on condition in query, how... to display books based on either bookname or authorname, for this i created one jsp page
How to get table row contents into next jsp page
How to get table row contents into next jsp page  Hi, I have a 30... contents in the next jsp page and display them Thanks Vikas   The given code retrieve data from database and display in the html table. At each row
Create a Table in Mysql database through SQL Query in JSP
Create a Table in Mysql database through SQL Query in JSP...; This is detailed java code to connect a jsp page to mysql database and create a table of given.... First page is to provide link to create table and the next page for processing
how to insert the bulk data into the data base from the table of jsp page to another jsp page
how to insert the bulk data into the data base from the table of jsp page to another jsp page  pls help i'm doing the project called centralized... to get values in array in next jsp page and insert into the row by row Please do
JSP Delete Record From Table Using MySQL
JSP Delete Record From Table Using MySQL This tutorial explains you that how to write a JSP for deleting a record from database table. In this section you... the code for executing this query and transfer the control from one page
pdf file in jsp
pdf file in jsp  i have a pdf, which has to be displayed in a jsp page along with some html tags, the pdf which is to be displayed shold be readonly and wont allow the uer to save too
how to display the database values in pdf format
how to display the database values in pdf format   in struts how to display the values in pdf format when clicking a button in jsp page   jsp code using itext api: <%@page import="java.io.*"%> <%@page import
how to upload an image from a jsp page to a mysql database table using jsp
how to upload an image from a jsp page to a mysql database table using jsp  how to upload an image from a jsp page to a mysql database table using jspstrong text
Dynamic retrieval od data from database and display it in the table at jsp
the details of 20 members in a table format at jsp page by dynamically retrieving...Dynamic retrieval od data from database and display it in the table at jsp ...; Here is a jsp code that retrieves the data from the database and display

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.