Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display 10 records per page

 
Radha Kethana
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI

I am developing a struts application. One of the requirement is I need to display 10 records per page out of like 100 records that I receive from Database. Does anybody know how to do this. And also I need to give an option to export all the database records in an xl file. Any website that coverts these topics?

Merrill Higginson - I hope you read this. Please help me on these 2 items.

Thank you in advance
Radha
[ October 03, 2008: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"radha",
I'm not sure why your question is directed only at Merrill. Does that mean you think only he can help you?

In any case, please check your private messages about an important administrative matter.
 
Shikhar Madhok
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the August issue of the Javaranch Journal. That has a detailed article on implementing pagination.
The part about exporting to excel should be fairly simple. But you will have to fire the query on the database again, and open a new page with the mime type as ms/excel.

HTH
Shikhar

Also please check your private messages
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like Shikhar gave an excellent response to your question. I'm flattered that you asked for me by name, but this just goes to show that asking a question in an open forum and letting anyone who knows the answer provide it is a better system than just asking one person.

As it happens, I haven't had much time to devote to JavaRanch lately, but luckily there are lots of knowledgeable, helpful people out there who can answer questions.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

you have to use paging for display 10 record out of 100.

Display tag which is plug-in for struts paging for limit record per page.

Thanks,
Nishan Patel.
 
Radha Kethana
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you everyone for quick response and suggestions.

I did not mean that Merrill is the only one who can help me. But, I always get exact reply back from him all the time. I thought He will look into the post for sure if I specify the name. I should not have done that.

Sorry for the inconvenience that I caused by specifying the name.

Greatly appreciate all your responses.

Thanks everybody
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Radha",
Please check your private messages and change your display name before posting again. Accounts with invalid names are subject to closure.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Radha

I think http://sourceforge.net/project/showfiles.php?group_id=73068

this will also help to export all record into xsl file and paging problem with less configuration and code.

if you solve your problem reply me.
 
Radha Kethana
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne - I changed my display name. Thank you for letting me know the impact of using proper names.
Nishan - I will definitely inform you once I implement. Thank you for your response.
 
Nyanas Kandhan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using display tag for pagination. A simple example can be downloaded from here. Struts Display Tag Pagination and Sorting Example
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic