Link to home
Start Free TrialLog in
Avatar of ehst
ehst

asked on

Repeating Column Headers when printing a table

I want to print out a report that is built as an html table.  I want each page to print the column headers and if possible, a footer (last row) on each page.  I thought just changing the <td> tag to <th>  would do it but this doesn't seem to work.  Thanks for the help.
Avatar of jbirk
jbirk

all that <TH> does is make it's contents bold, so as to look like a header.  It doesn't do anything for placement in the table.
I'm not exactly sure what you are looking for.  Could you perhaps provide the code you currently have and explain what you would like it to look like.
Or explain in a little more detail?

-Josh
Avatar of ehst

ASKER

Right.  I just want to be able to print a hard copy of the report with the headings showing up on every page.  
I'm afraid, I still don't fully understand.  You say print a hard copy, so I assume you mean when the user clicks on the print button?  For this to work it has to be actually on the web page how you want it to look.  It should look the same when printed except when using background images and layers and then the printed copy tends to look different.

What are you using to generate these reports?  CGI, JavaScript, ASP, etc..

-josh
Avatar of ehst

ASKER

We're using a VB ActiveX dll called through ASP.  The dll builds the report and sends it as an html <table> to the ASP.  Yeah, I want to just use the print button.  Is there a way to put in page breaks maybe to start a new table after so many rows?  I guess if it only prints exactly whats on the screen I'll need to build a printable report as a separate option.
Yes, unfortunately, AFAIK there are no commands to control how it is printed out.  It just prints exactly what's on the screen.
So if you can get the screen to look how you wanted it printed then you're in business.

Unfortuantely I know no ASP or ActiveX, so I can't help with that, but any html/javascript issues you have with this question I can assist you with.

Also you bring up a question about controling page breaks, and this is a question asked in the past, and the conclusion is always that there is no good way to do it, but ways to try and enforce it.  It can get kind of complex, and I haven't played with this, but I know others on EE have, so maybe they can help with that.

Good luck!
-josh
Avatar of ehst

ASKER

Thanks for your help.  If anyone else has ideas let me know.
On the risk of speaking just to speak, I think formatting the page to the printer is almost next to impossible unless you format the html page to the way that you want it to look. On an abstract level, you can change and filter anything between the person's computer and the server. But the printer is on the other  side. Security is a big issue regarding that. Allowing access to someone's printer is dangerous. ActiveX allows you to do some stuff on that side, since the person allows some access to their computer. But I haven't heard of anyway to do it with that either. This is just from my experience and would like to know otherwise.

Does ActiveX allow you to send text to a stream or an object that can still be sent to the printer? Again, I think security might limit you on that one.

a.
I would suggest using hjorizontal frames. 3 of them. A small one at the top for your header, the middle frame,where all your information is, and another small one at the bottom, for your footer. this will work.
Browsers only print the currently active frame.  At least this has been my experience (I don't do much printing from web pages).  So how would this do what he asks?
-Josh
Avatar of ehst

ASKER

Yeah, I don't see how this will work.  Even if you choose to print all frames, will the top and bottom frames get reprinted with the text in the middle frame that doesn't fit on the first page?
ASKER CERTIFIED SOLUTION
Avatar of alweiner
alweiner

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is a good suggestion alweiner.  I agree.  If you want to control the output of a printed report generate it in another format and make downloadable.  You could pdf which can be plugged into the browser or you could use something like word.
-Josh
jbirk : Internet Explorer prints out what you see on your screen. That means all of the frames. Please do not reject my answer without knowing exactly what I mean. If you do not know how all you have to do is comment it
what patricia said is true. Internet explorer prints all of the frames. It give you the choice to print whatever you want.
So how that work with frames that have scroll bars?
Does it just print the visible part at that time?
As you can probably tell, I'm a netscape user...
-Josh