aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Pagebreak in JSP Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pagebreak in JSP Page" Watch "Pagebreak in JSP Page" New topic
Author

Pagebreak in JSP Page

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Hello Ranchers
I'm doing project in jsp oracle.. in a search query it retieves datas from the database and display in the jsp page .. inside a <table>

there are 30 records in the database.. and all the records are displaying when i run the query..
It is a status report.

so when i want to print the jsp page.
the page layout is not good.. the last line in the first page and the first line in the second page is not properly comming.

is it possible to put a page break

like this
--------------------
<table>
<tr>
<td>Name</td>
<td>Age</td>
</tr>
<tr>
<%
int i=1;
while(rs.next())
{
String name = rs.getString(1);
String age = rs.getInt(2);
i++;
%>
<tr>
<td> <%= name%> </td>
<td> <%= age%> </td>
</tr>
<%
if(i==15)
{ i=0;
%><pagebreak>
<%
}
----------------------------------------------------------
is something like this is possible
i've given <br><br> like this
but the 3rd page is not comming..
is there any possible way to print the datas in format!!
please help me!!
ranchers
Krithika Srinath
Ranch Hand

Joined: Apr 11, 2006
Posts: 52
Hi Arvind,

You can use CSS styling



Note: If in case you want to enhance your UI and display say 10 records initially and display next set of records on click of "Next" or "Previous" link, you can do so by implementing Iterator pattern and use IFrames with in the page. However, this would involve additional coding and it depends what you are trying to generate as output.

Regards,
~Krithika
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Moved to the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagebreak in JSP Page
 
Similar Threads
Value not being sent to DAO class from Struts form in JSP
Problem in displaying table using struts logic:iterate tag
Struts action not returning page on first click of button
retreiving all rows from a mysql table to a jsp page
two dropdown menus