Reports: one page too many

Hello, I made a report with a counter using the virtual table “Integer”. The problem is that when the report is printed, one extra blanco page comes out of the printer as well after each itteration. That means that if I want to print a certain report 100 times, I get 100 reports and 100 blanco pages. I just can’t figure out what to do about this. Has anyone experienced this, and how can I solve it? With regards. Anolis Sittard Netherlands

Are you using ‘group totals’ and ‘new page per group’ somewhere in your report? Regards, Mark Dielmann

No, I don’t. Anolis Sittard Netherlands

There are three possibilities: You have somewhere … 1) NewPagePerGroup=Yes 2) NewPagePerRecord=Yes 3) CurrReport.Newpage You should forget about the NewPagePerxxx property generally. The CurrReport.Newpage is a good solution but it requires to do a read-ahead to determine end-of file. For example: You want to have a new page after every customer unless the last customer is printed: locCustomer.copyfilters(customer); if > 0 then currReport.NewPage; Marcus

Thanks, that’s a very useful tip! Anolis Sittard Netherlands

Some small points: NewPagePerRecord still will give u a blank page at the end of the report in lots of cases (when u’ve got a header printed on each page it usually happens). That’s ‘cos Navision reads the next record AFTER printing the page header, so when it detects that no more records are it’s started a new page(it starts printing, reads a record, sends the new page signal and then tries to read the next record). For solving this bug, if u’re not using groups and it’s a single field key’s record, u can group by the key field and use newpagepergroup. NewPagePerGroup, as difference from newpageperrecord, for being able of grouping together all the records of the same group reads the records before the header’s printed (start reading the records and read all records until it detects the group’s changed, then prints the readed data), so it will detect the end of the record’s list and won’t print the blank las page. Just a note about marcus’ way of obtaining next record… >> locCustomer.copyfilters(customer); if > 0 then currReport.NewPage; << In this methos you’ll need add a bit of code for being sure u’re located in the same record in the locCustomer variable as you are in customer’s one. Faster way should be: locCustomer.COPY(customer); locCuctomer.GET; if <> 0 then currReport.NewPage; – Alfonso Pertierra Spain