From: Roger H. <cro...@ya...> - 2005-09-20 20:15:15
|
--- Geoffrey Talvola <gta...@na...> wrote: > You might try to produce a "printer-friendly" version of your HTML > reports. > You can use the CSS style "page-break-before: always" on a <P> tag to > force > page breaks where needed. For instance, if your report consists of a > large > HTML table, you may determine through trial and error that you can > comfortably fit 20 rows on one page. Then split up the table into > multiple > tables with no more than 20 rows per table and insert <p > style="page-break-before: always"> in between each one. This will > require a > bit of experimenting and tweaking with different browsers to get it > right, > and it may not always work 100% correctly, but it may be good enough > depending on your use case. > > You can have a "view" version of the report in which all of the data > is > contained within one large table for online use, and provide a link > to a > "printable" version of the report in which you split up the tables to > fit > one per page, strip out navigation links, etc. > > The nice thing about this is that the HTML reports will probably be > much > nicer to use online than a PDF report would (does anyone actually > like > viewing reports online using a PDF viewer?). They probably won't > look as > nice when printed though. > > I've used this method with some success -- it's not perfect but given > the > choice between nice-for-printing PDF reports that are a pain to use > online, > and acceptable-printing HTML reports that are a pleasure to use > online, I > prefer the second choice. > > - Geoff > > If you are using Firefox (and maybe the latest Netscape and Mozilla), there is support for the THEAD, TFOOTER, and TBODY tags. Just by wrapping the heading rows of a table in thead, Firefox will print the heading rows on subsequent pages -- no need to use the page-break-before method on large tables. This, combined with liberal use of "dispay: none;" under the "media print" section to eliminate the printing of buttons and other things not relevant on a printed page creates printed output close to perfect. Firefox deserves another plug here; if you are not using Firefox to develop your application's html, you are missing out on some great tools. There are several fantastic developer extensions (click Extensions under the Firefox Tools menu). I use the Web Developer, HTML Validator, and View Formatted Source extensions every day. Roger Haase __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |