Leenaa
27th March 2003, 07:12
hi all ,

how can i get the total pageno in the starting of the report or

i want to print 1 of 5 ,2 of 5 ---------- at the starting of every

page in case of five pages report!!!!


thanx in advance !

NPRao
27th March 2003, 07:31
Leena,

Please use the Search options on the Board for already discussed topics.

Refer to the links -

Page x of y: Kevin Brock's solution (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1079)

Page x of y: Jo Büche's solution (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=6190)

Leenaa
5th June 2003, 09:12
Hi vamsi !


i was trying ur this solution to count the last number of report ,but it is not helping me out,
it is showing total.pages = 0 where the repot has 2 total pages .


********************************************


domain tcmcs.long total.pages
domain tcbool page.of

before.program:
import("page.of", page.of)
if page.of then
total.pages = 0
else
import("total.pages", total.pages)
endif

after.program:
|Send the current and final page count back to the parent session
if page.of then
export("total.pages", total.pages)
endif
--------------------------------------------------------------------------------


Then, change the header (or any other layout) of the report to include the variable "total.pages" where you need to show the total page count. That's it for the report. Comile it.




where can b the mistake and from where it will import the page.of
.

thanx in advance

mark_h
5th June 2003, 23:54
For reviewing the post of Kevins solution I do not see where the main session is doing the export and import of the total pages. So in the main session before calling the report I would export the total pages variable. Then after the read.main.table and brp.close() I would import total pages.

Just my guess since I have never used Kevins solution.

Mark

lbencic
6th June 2003, 17:35
I also have never used. You can pass that total.pages from the program to the report script by including it as an Import Field on the report, and making sure it is declared as external in the program script.

Leenaa
7th June 2003, 05:46
hi thanx all for ur suggestions,i''ll definately try this,

hi guru (Rao) can u just tell me abt this Kenvin's solution,as u adviced me to use this solution .


thanx in advance

mark_h
8th June 2003, 20:01
Leenaa,

Kevins solution is probably the easiest method to do this with. You are basically running the report twice - once to get last page and once to print the report with Page x of y. It is important when using this method that you get the spool variables and such set exactly like the actual printer. This will help set the page count.
The only problem with this is if you have 100's of pages for a report, it could be slow. But still this is the easiest method. I have managed to convince my users that this is not necessary any more. What else would you like to know?

Mark