nothing
07-23-2006, 09:50 AM
Hi. I wrote a C++ program that generates a .html file with the information it gets from a database. The program basically creates tables on the page and puts some names in each one of them. In order to print this page, my program opens it in the default browser and I do the rest from there. The problem is that sometimes the last table on the page gets cut in half because it doesn't fit in full on that page. I was wondering if it is possible to force a jump to the next page even if there is still room on the current page. Say, two tables per page. Do I make myself clear enough? Thank you.
jjinno
08-12-2006, 06:11 PM
I ran into a similar problem when coding a reporting system for a Vetrenary Clinic. The actual problem isnt caused by your code so much as the browser, and its interpretation of the HTML. Unfortunately, if you want to stick with just HTML, you are looking at doing something like this:
- count the number of lines of text
- if greater than X, then add 5 line-breaks
- reset counter at current line and loop
However, like I said, I did run into this exact same page-break problem before. My solution was to write my own XML using the open-source Jasper Reports DTD. Its a little overwhelming at first, but they have great examples on their website, and because the entire thing is based upon exact pixel measures, you can guarantee that your page overflow is not cut in half.