| | |
Design for A4 printing HTML report - Pg Break?
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2006
Posts: 4
Reputation:
Solved Threads: 0
I need to produce a 'report' from a whole bunch of different criteria used to generate the resulting document on the web.
This will need to be printed to an A4 sheet, but here is the rub - I need to be able to control page breaks. I need to show certain things on page 1, then a new page 2 and so on.
Is this possible??
Big problem is that I don't know where I need the pagebreak - its dynamically generated content from a number of options, which results in the finished document.
Its one of those things that is so close to working, but I cannot use it as the resulting report looks shit - and it's a report that clients see and also product providers, so it has to look decent.
Can someone show me the way on using Javascript to perform the A4 size calculation?
This will need to be printed to an A4 sheet, but here is the rub - I need to be able to control page breaks. I need to show certain things on page 1, then a new page 2 and so on.
Is this possible??
Big problem is that I don't know where I need the pagebreak - its dynamically generated content from a number of options, which results in the finished document.
Its one of those things that is so close to working, but I cannot use it as the resulting report looks shit - and it's a report that clients see and also product providers, so it has to look decent.
Can someone show me the way on using Javascript to perform the A4 size calculation?
This is an "issue" I've visited many times. Unfortunately, formatting HTML to be viewed in a web page that will print exactly the way you want is near impossible---you aren't allowed that kind of control over the formatting with HTML.
With CSS, you can insert page breaks.
http://www.w3.org/TR/REC-CSS2/page.html
The other problem people have is how to know when to insert the page-breaks. For example, if I have 500 rows of data to print in a report, and I want a header and footer on all pages, and I want each page to nicely fit an 8.5 x 11 page, how many records can I print on each page? Good question! All you can do is set the font-size and line-height, etc using CSS, then make your best guess (trial and error) as to how many lines fit per page. If you have to deal with lines possibly wrapping---ouch--your job is that much more difficult.
If you REALLY need the report to look professional, and exact formatting is required, then this is what PDF's are designed for. You can programattically generate PDF's on the fly and serve to your customers on your website. Moderator Tgreer (www.tgreer.com) on this forum is one of the leading Postscript / PDF experts in the country and can provide further assistance. Maybe he will chime in on this thread.
With CSS, you can insert page breaks.
http://www.w3.org/TR/REC-CSS2/page.html
The other problem people have is how to know when to insert the page-breaks. For example, if I have 500 rows of data to print in a report, and I want a header and footer on all pages, and I want each page to nicely fit an 8.5 x 11 page, how many records can I print on each page? Good question! All you can do is set the font-size and line-height, etc using CSS, then make your best guess (trial and error) as to how many lines fit per page. If you have to deal with lines possibly wrapping---ouch--your job is that much more difficult.
If you REALLY need the report to look professional, and exact formatting is required, then this is what PDF's are designed for. You can programattically generate PDF's on the fly and serve to your customers on your website. Moderator Tgreer (www.tgreer.com) on this forum is one of the leading Postscript / PDF experts in the country and can provide further assistance. Maybe he will chime in on this thread.
![]() |
Similar Threads
- Printing HTML from VB.Net (VB.NET)
- Printing Data Report Directly in vb.net (VB.NET)
- AJAX : Am i right with the concept? (JavaScript / DHTML / AJAX)
- communication HTML and ASP.NET (ASP.NET)
- How to create Dynamic Page Break in HTML? (JavaScript / DHTML / AJAX)
- WinXP, RH9, Samba, and Printing (*nix Software)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Scrollable Suckerfish Menus?
- Next Thread: Status Bar Message Problem
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box bug calendar cart checkbox class codes column createrange() css cursor date debugger decimal design dom download dropdown element embed enter error explorer firefox focus form frameworks getselection google gwt hiddenvalue hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 object onmouseover paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select shopping size software sql text textarea toggle unicode w3c website window windowofwords windowsxp wysiwyg





