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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intelligent (?) Page Breaks

Status
Not open for further replies.

Craigieboy

Programmer
May 25, 2001
71
GB
Hi all

I'm hoping someone could offer guidance on an IE page break issue I have.

I am producing a report in the browser which is dynamically built from a number of database tables. There is a "front" sheet which is generally fixed in size and will not spill onto a second page. At the foot of this page I insert a page break and begin building my second page.

This is now where my problems begin. This second page could be any length, and crucially contains many blocks of text of any size. My issue is that the business unit at my company does not want a block of text splitting over multiple pages. So my code needs to be intelligent enough to recognise that a block is split, then insert the page break at the start of the block. If there are several blocks of text then a page break could, in effect, fall over any of the blocks of text, so at no stage am I ever going to know which block wil have a break in it.

Is there any way I can add this "intelligent" page breaking?

I have made every effort to use styles page-break-before, page-break-after, etc, etc.

Many thanks in advance,
Craig

 
I guess you need to count the size of the data that you are adding to your output and develop a method to determine how many chracters/words per line and how many lines per page.

do while not rs.eof
lineCount = lineCount + getLines(rs("fieldName"))
if lineCount > 45 then pageBreak = "always" else pageBreak = ""
strHTML = strHTML & &quot;<p style='page-break-before = &quot; & pageBreak & &quot;'>&quot; & rs(&quot;fieldName&quot;)
rs.movenext
loop

function getLines(inString)
charsPerLine = 100
getLines = round(len(inString) / charsPerLine)
end function



Never tried any of this. Good luck

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
Thanks for the speedy reply - I'll give it a go! Anyone with any other input would be most welcome.

Cheers
Craig

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top