learner
5th June 2009, 18:05
Hi,

I have a pretty simple print session which sends some Order data on report including header text, now the problem which i am facing is with respect to page(). :(

Following are the layouts which i have defined within report


before.whinh200.orno.10:
Basically Ship to BP address details are printed

before.whinh200.orno.20:
order header text is printed ( header text can be 2 lines or may be 40 lines , its dynamic )

before.whinh200.orno.30
Labels like Order , pos, item are printed

detail.10:
Actual data is printed

after.whinh200.orno.10
a blank line is printed



Now my requirement is as soon as header text is printed via second layout i.e. before.whinh200.orno.20:, if it has exceeded lets say 35 lines on first page, i want my third layout to be printed on totally new page... but somehow page() doesnt work in before.layout, if i define the function page() in detail layout in r.script , it works... any idea what could be possible reason that page() doesnt work in before layout of order??

i read help for page() and it says it won't work in header & footer layouts, but doesnt say that u cant use in before.layout :confused:

i am clueless , if u have any other suggestion to achieve the same req. i dont mind working towards new approach. :)

Waiting for your reply.

Regards

Learner

MilindV
7th June 2009, 17:35
Sir,

In before.whinh200.orno.20: layout you can use text.to.buf function, using which you can find out no. of lines that the text contains.
Now In before.layout 3rd layout before.whinh200.orno.30 you can check whether 2nd layout has printed how many lines. call page() function in this before layout of 3rd layout depending on how many lines got printed in 2nd layout.

You have not mentioned in code snippet, exactly in which layout you have placed page() function.

or may be you can check lattr.lineno in before layout of 3rd layouts before.layout

Thanks & Regards
MilindV

learner
8th June 2009, 20:27
Hi Milindv,

i have placed page() inside before.whinh200.orno.30 layout where Labels like Order , pos, item are printed.

Problem is even though i have placed page() function in before.whinh200.orno.30 its not getting invoked or in other words its not creating a new page :-(

But the same thing works if i place the page() function in detail.10 layout

Regards

Learner