aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Print row data from a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Print row data from a JSP" Watch "Print row data from a JSP" New topic
Author

Print row data from a JSP

Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Apr 27, 2007
Posts: 66
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Print row data from a JSP