how to add the two tables in same row when generating pdf file from jsp

how to add the two tables in same row when generating pdf file from jsp

How to add the two tables in same row one is left side and other is right side please help me.

View Answers

February 22, 2010 at 5:29 PM

Hi Friend,

Try the following code:

<%@page import="java.io.*"%>
<%@page import=" com.lowagie.text.*"%>
<%@page import=" com.lowagie.text.pdf.*"%>
<%@page import=" java.awt.*"%>
<%
Document document=new Document();
PdfWriter.getInstance(document,new FileOutputStream("C:/tablePDF.pdf"));
document.open();
PdfPTable table=new PdfPTable(2);

PdfPTable table1=new PdfPTable(1);
table1.addCell ("Roseindia");

PdfPTable table2=new PdfPTable(1);
table2.addCell ("Delhi");

table.addCell(table1);
table.addCell(table2);

document.add(table);
document.close();
%>

Thanks









Related Tutorials/Questions & Answers:
how to add the two tables in same row when generating pdf file from jsp - JSP-Servlet
how to add the two tables in same row when generating pdf file from jsp  How to add the two tables in same row one is left side and other is right side please help me.   Hi Friend, Try the following code
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
Advertisements
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
how to set the image and address in single row when genearting pdf fil from jsp - JSP-Servlet
how to set the image and address in single row when genearting pdf fil from jsp  i need to set the image is left side and right side is address when genrating the pdf file from jsp  Hi Friend, Try the following code
add same tables in jsp page
add same tables in jsp page  hi I have a table in my jsp page with data, now I want to add same copy of table without its default value in same page whenever I click add more table, how do I do
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
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
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
pdf file is having the 0 KB when generate the pdf file from jsp - JSP-Servlet
pdf file is having the 0 KB when generate the pdf file from jsp  Hi Friend, I am getting OKB pdf file .if i inserting the image into pdf file , i am getting the OKB pdf file now and also not able to open the pdf
how to get values for same column name from two different tables in SQL
how to get values for same column name from two different tables in SQL  how to get values for same column name from two different tables in SQL???? column name is emp_id loacated in these two tables company,employee
openning the pdf or doc file in same jsp
openning the pdf or doc file in same jsp   **how to open the pdf and doc file in same jsp after clicking the link or button (which is with out moving to the next page). will some body help me on this @simple format please
how to generate the pdf file with scroolbar from jsp age - JSP-Servlet
how to generate the pdf file with scroolbar from jsp age  How to generate the pdf file with scroolbar from jsp.i am not able to see the all the columns in pdf file now .it is very urgent for me plz help
how read data from doc file in same formate in jsp
how read data from doc file in same formate in jsp  how we can read and display data on jsp page, from doc file with the same formatting
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
how to get the image path when inserting the image into pdf file in jsp  Hi Friend, my image path;C:/images/photo.jpg. i am getting the below...: Thanks  I am getting the same problem. error is coming
Generating PDF reports - JSP-Servlet
Generating PDF reports  Hello everyone i have submitted several... Question I am try to generate a pdf report using jsp .... i want to export.../itext/helloServletPDF.shtml http://www.roseindia.net/jsp/file_upload
how to get the image path when inserting the image into pdf file in jsp - JSP-Servlet
how to get the image path when inserting the image into pdf file in jsp  I am using the below code but i am getting the error at .getInstance. i am using the itext.jar now.Plz help to me <% Document document=new
How to add two calendars on the same html page
How to add two calendars on the same html page  I have used the same...-calendar.shtml for implementing calendar for my project.and the code is working fine when i use single calendar for a single html page.but while implementing two calendars
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
display multiple image file or pdf file in multiple column of a row from server or database
display multiple image file or pdf file in multiple column of a row from server... in a single row..Suppose I have to display two files in a row then after uploading more files then uploaded file should be display again tow file in another row
SQL Server row comparison using two tables
SQL Server row comparison using two tables  insertion process are completed in table1.string comparison using table2 to table1 if any changes in these tables and then upadated
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
how to generate the pdf report from jsp
want to generate the pdf file from jsp page.I add the itext.jar to the libraries...how to generate the pdf report from jsp  <%@page import... not getting the pdf file.Any one please help me asap.Its very important
ADD ROW - JSP-Servlet
ADD ROW  Hi Sir, How to use add row and delete row concept in jsp .  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/add-element.shtml Thanks
How to change table row color when click on Hyper Link in jsp?
How to change table row color when click on Hyper Link in jsp?  I use... row2 row3.. when click on the link1 automatically change the the row1 color,similarly when click on the link2 automatically change the the row2
i am getting the problem when i am downloading the pdf file from oracle 10g database - Struts
i am getting the problem when i am downloading the pdf file from oracle 10g database  if i created the pdf file from pdf machine,it is storing into datbase and download the pdf file from database. but when i created the pdf file
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
search in Two Tables to Find data and view by jsp
search in Two Tables to Find data and view by jsp  hi i want search in Two Tables to Find data and view by jsp <%@page import...; Have a look at the following link: JSP search using two tables   
sql query to get data from two tables
sql query to get data from two tables  how can i get the data from two different tables?   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 JOIN Query Simple Query ThanksADS_TO_REPLACE_2
How to generate the pdf file using jsp - JSP-Servlet
How to generate the pdf file using jsp  Hi how to generate the pdf file in jsp  Hi Friend, Try the following code: Thanks
display the hidden text from that row, when onclick on a row of 1- 10
display the hidden text from that row, when onclick on a row of 1- 10  Using JSP: I'm displaying a set of values from the databse in a table rows (1 to 10)in jsp page, when onclick on one of the view row, it has to submit
generating itext pdf from java application - Java Beginners
generating itext pdf from java application  hi, Is there any method in page events of itext to remove page numbers from pdf generated frm java application.  Hi friend, Read for more information. http
how to retrieve data from multiple tables in jsp using javabeans
how to retrieve data from multiple tables in jsp using javabeans   ... for retrieving data fromm two tables : first table having fields: bookid,name...).second .java file for getting data from second table- package pack; public
how to retrieve data from multiple tables in jsp using javabeans
how to retrieve data from multiple tables in jsp using javabeans   ... for retrieving data fromm two tables : first table having fields: bookid,name...).second .java file for getting data from second table- package pack; public
how to retrieve data from multiple tables in jsp using javabeans
how to retrieve data from multiple tables in jsp using javabeans   ... for retrieving data fromm two tables : first table having fields: bookid,name...).second .java file for getting data from second table- package pack; public
How to solve concurrency issue when an application is running on two machine to fetch record from one database
How to solve concurrency issue when an application is running on two machine... in java to run on two machines. Program will fetch a record from database and process it. I want to make sure that when application run on two machine
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 know the selected row from table - JSP-Interview Questions
How to know the selected row from table  hi Every one....i am retriving data from database and i place that data into html table.in that table i place one table data as hyperlink. now the problem here is how can i know
Generate pdf file - JSP-Servlet
Generate pdf file   Hi Friends, How to generate the pdf file for the jsp page or in servets  Hi Friend, You need to download itext api. After that set the classpath and try the following code
reading a csv file from a particular row
reading a csv file from a particular row  how to read a csv file from a particular row and storing data to sql server by using jsp servlet
How to write .properties file from jsp
How to write .properties file from jsp  Hi i new to java i stuck here... to implement/write .properties file from jsp. Regards, Venkatesh Gurram.ADS... is when i am using this in jsp means i have create object to this class and used
Java Program to insert a row in the same sheet of excel file
Java Program to insert a row in the same sheet of excel file  Java program to insert a row in the same sheet of excel file using poi package in java
how to generate PDF file using JSP with net beans
how to generate PDF file using JSP with net beans  I am trying to generate PDF file using JSP. I even added itext5.0.6 jar file in library. It shows...: Compiling 1 source file to C:\Documents and Settings\Administrator\My Documents
Generating pdf in Spring
Generating pdf in Spring  Sir/Madam, I need your help in generating a pdf by fetching the data form database and by using unicode in spring framework
How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi Sir... the file in cell if a table in same page, post answer as soon as possible.thanks in advance. Regards, Santhosh   Here is a jsp upload file application
How to browse and upload the file in same page using jsp.
How to browse and upload the file in same page using jsp.  Hi, I am doing a project and i want to browse and upload the file in same page inside.... Regards, Santhosh.   Here is a jsp upload file application. The given code
Joins tables in jsp
Joins tables in jsp       When we want to select data from two or more tables...; Here are two tables and result will be from both tables on the basis
how to add two object in a particular file - Java Beginners
how to add two object in a particular file  Hi frend.. I have two arraylist object in which there is some data..............now i want to add these two objects in a particular file using file handling in java....and also

Ads