• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Print Jsp page(s)

 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm using the value list handler pattern to display the recordset in multiple pages.
10 records are displayed per page , when the next button is clicked the same page will get reloaded withe the next 10 rows.

Now i face a problem in printing the records , when ever print button is clicked i want to print all the pages.

How can i do this ? Is there any feasible solution ?
Plz guide me..

Srini
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
create a JSP that displays all the records in a printable layout and open that on pressing the button.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:
create a JSP that displays all the records in a printable layout and open that on pressing the button.



Cant i do the same without opening any new page ?
Wat i was thinking is to have a hidden iframe that has all the contents & print the same ... but it's not working ..

Srini
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try it out without using iframe. just load the printable version in the same page.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by adeel ansari:
try it out without using iframe. just load the printable version in the same page.



Adeel,
I cant get u ..
See for example i'm in one page if i give print i need to print all the pages.
Do u mean to load all the records in one page and print the same..

Srini
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah. just give it a try.

but i think there shouldn't be any problem using iframe. it should work fine.

are you printing directly from the browser or using some javascript print function for the browser?
[ October 14, 2004: Message edited by: adeel ansari ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problem with that approach is that you ALWAYS send all data over the network even if you're not displaying it.
As paging is usually employed to prevent just that you're being counterproductive here.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:
the problem with that approach is that you ALWAYS send all data over the network even if you're not displaying it.
As paging is usually employed to prevent just that you're being counterproductive here.



So what shd i do ?

Now i'm popping up a small new window, which closes immediately after printing all the records.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that's likely the best way, and is used frequently (also for example when the regular page contains things like menus, colours and stuff you don't want on the printed page).
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by adeel ansari:
yeah. just give it a try.

but i think there shouldn't be any problem using iframe. it should work fine.

are you printing directly from the browser or using some javascript print function for the browser?

[ October 14, 2004: Message edited by: adeel ansari ]



I'm using the javascript function for printing.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by srini vasan:


So what shd i do ?

Now i'm popping up a small new window, which closes immediately after printing all the records.



sounds fine.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic