Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

click one button and print automatically 1

Status
Not open for further replies.

desiana

Programmer
Oct 31, 2001
23
0
0
MY
I am doing a program in JSP. I have one button called auto generated. When user clicks on it, it will automatically print all data located in a table without actually displaying it on the screen. Is it possible to do that ? And one more thing : the data needs to be printed is segmented in tables and I want to print each table in each page. How can I set it to be like that ? Thanks
 
faq216-738 might get you going in the right direction...
 
I think if I use the method in the FAQ, users still have to modify by themselves. What I want is every table will be printed on exactly a separated page without having to do anything. So let's say, I have four tables. When users click that print button, each table will be printed on different page. How to do that ??
 
Try this.
Code:
style="page-break-after: always;"
First, try to place that in your opening <table> tag. Other options would be to setup a style like this.
Code:
<head>
<style>
table {
      page-break-after: always;
      }
</style>
</head>
That would force a printer page break after every table or you could do something like this.
Code:
<head>
<style>
p {
  page-break-after: always;
  }
</style>
</head>
And then place a <p> wherever you want a printer page break.

Sorry, IE only. Netscape will not honor this method. There may be other solutions out there that are Cross Browser compatible, but I'm not aware of them.

ToddWW
 
Thanks. I actually got that here in JavaScript or HTML or one of those forums a few weeks back.

It's a pretty cool little trick, I put it to use in my reporting module immediately. Works great !! Would be nice if Netscape would get off their butts and adopt some of these cool methods.

Thanks again.

ToddWW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top