report sections: keep with next-property

First I would like to thank you very much for the answers of the question i posted some days ago, they were very useful to me. I have another question: I have to create a report that prints some summary information, for each value in a master data item i have to print out the content of its child - my problem is: sometimes in bottom of a page (some cm before the page ends) a new block begins but because there are only few cm of space only the header prints out and the body is placed on the next page (this looks really uggly) - to avoid this i erased the header (which contained the labels of the body fields) and created instead 2 body sections, the first one containing the labels and the textboxes (it prints only for the first record, i use an integer var. to count the records) and the second one containing only the textboxes (it prints for all record>=2); i also created a transfooter and -header which prints “xxx continues on the next page …” - now in the worst case in the bottom of the page only the header and the first record is printed, but this still looks quite uggly - my answer is: in the first body section (the one with the labels AND the textboxes) the “keep with next”-property which should keep together sections of the same type is set to “yes”, why navision doesn’t start a new page, but prints out the labels and the first record in bottom of the page like i described before // what else could i do to solve this problem? is it possible to determine in a trigger at which height of the page the report is in the moment that code is executed and to insert a page break if there are only few cm remaining and a new block has to be started? THANK YOU really much ?

Hi, Perhaps the solution is this: The property Keep With Next for all the sections must be set to the same value. If you only set the first section to Yes and not the other, this will not work. Best regards Daniel

thank you daniel, but it doesnt work, i’ve already tried various combinations martin lang ?

It’s really crude, but it does work, you can count lines. In each section you’re printing you can update a counter of the number of lines that section will print. At the beginning of each section you can put logic to decide whether you want to print that section on this page or force a new page, based on the number of lines you want to be remaining available at the time this section prints. For example, for the body section you might let Navision control. For the header section, you might force a new page if there isn’t enough room left for the header and (for example) three body sections (for better appearance). Like I said, crude but that’s the way we used to always do it before tools like report writers (back when we used to code on stone tablets). Dave Studebaker Liberty Grove Software A Navision Services Partner

Ciao, You could try firing a CurrReport.NEWPAGE under certain set of circumstances. It will print headers/footers as usual, but will not print trans-headers and trans-footers. Once I did a “read-ahead” function to do similar things, for example in a sales order SalesLine2.COPY(“Sales Line”); IF (SalesLine2.NEXT<>0) AND THEN etc. Alex