I'm trying to find a good way of performing a mathematical calculation based on given quantities and logic, but my brain isn't working today so I was hoping someone might have done something similar and could provide some insight.
Here's what I'm trying to do.
I have "sections" of data. It's XML. I'm essentially wanting to force a page break before the data gets cut off by the PDF control in my web application. I've determined some number for "maximum data to be on the page" - let's call that 100.
So what I'm looking at right now is about 20 "sections" and performing some sort of logic like this:
Section A + Section B > 100
Page break before Section B.
Section A + Section B < 100
Section A + Section B + Section C > 100
Page break before Section C.
Section A + Section B + Section C < 100
Section A + Section B + Section C + Section D > 100
Page break before Section D.
Please let me know if you can think of another way to do this that would be less......verbose.