Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Print row data from a JSP

 
Steve Renard
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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..
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic