• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagebreak in JSP Page

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the HTML forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic