This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to display 10 records per page

 
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 ]
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • 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.
 
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
 
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.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • 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
Posts: 40200
816
Eclipse IDE VI Editor Java
  • 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
Scala Eclipse IDE Java
  • 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.
 
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
 
Do you want ants? Because that's how you get ants. And a tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic