• 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 row data from a JSP

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a database table in my JSP.
When I select a row in the table and hit "Print", it needs to print the fields on a paper.
I open a separate window when "Print" is hit and show the print dialog.
My question is how do I carry the field values from the parent JSP to the new window and print them.
Please help..
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
grab the row id howver you are selecting the row, append a querystring value with the id and load the values from the server. OR look at the table cell's innerHTMLand pass those as qs parameters. hav the javascript grab the qs valus and write them to the page.

Eric
 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..
Do you have any code samples I can look at...
I too have the same idead of implementing.
But I'm stuck at how to pass it to a new window and print from there..
Code samples would guide me better.
I appreciate your help..
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure how you are getting or selecting the id of the row. If you would have mentioned that, I could have helped you out a bit more.



on yourPrintPage.jsp you can do



Eric
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic