Colors and borders in reports?

I’m working with Navision 3.70 and I’m printing up a report. I’m trying to simulate a border by looping over rows in a database and printing vertical lines on each side, with the top and bottom added manually, i.e. ------------------------ | this line repeats | | this line repeats | | this line repeats | | this line repeats | | this line repeats | ------------------------ This works well enough, but there’s a problem: if the database doesn’t have enough data to fill up an entire page (usually the case), I still want to have the rectangle fill up the page. It should look like this: ------------------------ | this line repeats | | this line repeats | | this line repeats | | this line repeats | | | | | | | | | | | ------------------------ However, I don’t know how to calculate the number of blank lines I should print, followed by the bottom horizontal line. Any clues? Thanks a lot! Aris

quote:


Originally posted by abomm
…However, I don’t know how to calculate the number of blank lines I should print, followed by the bottom horizontal line. Any clues? Thanks a lot! Aris


You have to know the number of lines on the page (trial and error?) and the number you printed (Counter). From there, just subtract [:D]

Try using preprinted paper :slight_smile:

I never tried it, but after you are done with all sections, remember current page, then start new dataitem (integer) that prints your border. when reacing new page, prevent printing any of the remaining sections (including footers).

make a whole page as one section, but then you will need to put a LOT of controls there. you can have array variables which are filled before printing every page…

We do that very often, and it’s pretty easy. The idea is to create a Filler to make sure you always print the same no of lines in every pages. Let’s say you have 50 lines on a page. OnPreReport(): MaxTotalLines := 50 LineCount := 0 Every time a section is printed (OnPreSection if SHOWOUTPUT is TRUE), you need to increase your LineCount. Ex: if your section includes 5 lines: LineCount := LineCount + 5; Every time you come in a new page, you need to reset the LineCount to 0. For your last section before the page footer, you need a DataItem of type Integer that we call “Filler”. Set the MaxIteration to 50. When you reach the end of your page, the report will enter in the filler section and loop a number of time equal to MaxIteration. For sure, if you already printed 20 lines, you don’t need a filler of 50 lines… you need 30 (MaxTotalLines - LineCount). To do it, you just need a body section of your filler (one line with your left and right borders), and put the following code: Filler, Body (1) - OnPreSection() CurrReport.SHOWOUTPUT(LineCount < MaxTotalLines); LineCount := LineCount + 1;

the above is the best (codey way to do this) however!, be aware that the page throws are an arse to catch and ensure you print your page footers in the correct place.