This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes display tag..Printing all rows of a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "display tag..Printing all rows of a table" Watch "display tag..Printing all rows of a table" New topic

display tag..Printing all rows of a table

Sue Pillai
Ranch Hand

Joined: Nov 04, 2004
Posts: 89
In my struts-based application, I am using the display:table tag to display search results in a table. I display 10 records at a time. There is a print option for this page.

While I could use:
<a href=javascript:window.print()>Print</a>
to print one page at a time, what do I do to print the entire search results fetched and not just the current page? Do I need Javascript?

I am unsure of whether this is a Javascript question or a JSP one because I am using the display tags. Sorry, if I have posted in the wrong forum.



SCJP 1.2
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63208

Any printing done at the client will only have access to the page that is being displayed. Perhaps you should consider alalowing your users to request reports in PDF?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sue Pillai
Ranch Hand

Joined: Nov 04, 2004
Posts: 89
Thank you.

I am allowing my users to export the search results to an excel file and they could print from there. I also have an "all" option that displays all the search results that they could print with the <a href> option I mentioned before. But they insist that they need a "print" button that would print everything (even though they are not displayed) I am not much of a front-end person and I was wondering if there was a work-around.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: display tag..Printing all rows of a table
It's not a secret anymore!