tring7172
5th February 2002, 18:13
I would like to add a total number of pages to each page of a report. Does anyone have this code available? It seems like it would be a fairly simple task, but BaaN does not support this feature.
Any help is greatly appreciated.
Thanks
ulrich.fuchs
6th February 2002, 09:27
*I think Baan should put a price on the solution of this question.*
No, sorry, it's no simple task. A Baan Report is formatted during
printing, so during printing page breaks and so on are generated. Every line is sent to the printing spooler and afterwards forgotten. So Baan has at no time a "complete" formatted printout of the report in memory, from where the total number of pages could be retrieved.
It's a conceptional problem. The only ways to solve this I can imagine are:
1) Precalculate the number of pages by using the number of records to be printed and the number of line on a page (only applicable for very simple
2) Somehow get the formatted output file from Baan (eg. on UNIX level), get the number of page breaks, and paste the total number of pages at a placeholder tag that is put on a report.)
Say you have something like "@@#@@#@@" put on the page header of your report, you could count how much of these tags you find in the spool file, and replace the tags with that number within the spool file.
Perhaps one could write such a filter also within Baan - Vamsi did something like piping the ttstpconv output to ghostscript somewhen, if I remember right... Same concept could apply here?
Han Brinkman
6th February 2002, 11:29
I have had the question in the past also very often.
Most of my customers where satisfied with this: print a note on the last page that it is the last page.
Most of them only want to make sure that they have all pages.
Rgrds,
Han
mark_h
6th February 2002, 13:07
I like the answer by Han the best - if your customer lets you do that. Also I did take the ghostscript piece in the code and utilities and add a piece that does the page x of y. ~Vamsi is currently looking at it and is wanting to convert it to a generic answer for both NT and Unix. I did it with a combination of awk and sed scripts. It is not real good answer yet. When we get it cleaned up we can post it in the code and utilities section.
Mark
lbencic
6th February 2002, 15:35
Vamsi -
Thanks for looking into this, people ask about it all the time. I have an old copy of Kevin Brock's solution. It is UNIX based, but some NT notes. I have never tried it. Unfortunately it's in hard copy format. If you think it would be useful to you, email me your fax and I can send it along. If you think I should post it as it, I'll try and find some time to type it in.
Lisa
lbencic@rmcis.com
~Vamsi
7th February 2002, 06:58
An update for those reading this thread. I did get the fax from Lisa. The process requires one to modify the source code of each of reports that needs to have Page x of y. This is achieved by sending data twice to the spooler. The first time the whole thing is processed just to get the page number and the second time this value is used in printing the "y" value.
I will post the complete posting some time this weekend. The last time Kevin posted here, he alluded to a more graceful solution. May be he will post it some day :).
As for extending on Mark's solution, I will have to do it may be towards the end of this month or beginning of next month. I will keep that on my radar.
~Vamsi
15th February 2002, 22:00
Check this thread (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1079).
Dwallace
23rd November 2002, 02:21
Question to anyone who's implemented Kevin's 'page x of y'. I have a program with this logic and it's fallen apart with the latest version of the ostprepdll (service pak 9 in IVc4). I'm getting 'out of dim' errors equal to the page lengths.
As Kevin's document describes, you override the page lengths - when I have more data than fits on one page - BOMB!
Anyway, I know BaaN made quite a few report print changes with this service pak so wondered if anyone had a clue?
To temporarily fix my problem, and run my report successfully, I am using the old version of the ostprepdll file....not a long term solution as you can imagine.
D