sang1285
14th October 2014, 10:50
Hello Support,

i have a customized session wherein i want to force a page break before printing a layout based on space left.


I have tried page(), need(), changing lattr.pageno, new page , extra need
but nothing seems to be working.

Can someone please help:

I am posting the script below:


before.shpm.copy.5:
before.layout:

lattr.pageno = 1 |amenon.12102014.n

select tdsls400.* from tdsls400
where tdsls400._index1 = {:whinh431.worn}
selectdo

endselect

shpe.txtn = 0
dlvp.txtn = 0

select tttxt002.* from tttxt002
where tttxt002._index3 = {"2", "Shp "}
order by tttxt002._index3
selectdo
if strip$(tttxt002.kwd2) = str$(whinh431.worn) then
if isspace(tttxt002.kwd4) then
shpe.txtn = tttxt002.ctxt
endif
endif
endselect

select tttxt002.* from tttxt002
where tttxt002._index3 = {"2", "dlvp "}
order by tttxt002._index3
selectdo
if strip$(tttxt002.kwd2) = str$(whinh431.worn) then
if isspace(tttxt002.kwd4) then
dlvp.txtn = tttxt002.ctxt
endif
endif
endselect

before.shpm.copy.8:
before.layout:
if lattr.lineno >= 55 and lattr.lineno <= 75 then
page()
endif

| need(20)

detail.31:
before.layout:
item.shpe.txtn = 0

select tttxt002.* from tttxt002
where tttxt002._index3 = {"2", "Shp "}
order by tttxt002._index3
selectdo
if not isspace(tttxt002.kwd4) then
ret = string.scan(tttxt002.kwd4, "%d/ %d", posno1, seqno1)
else
posno1 = 0
seqno1 = 0
endif
if strip$(tttxt002.kwd2) = str$(whinh431.worn) and
whinh431.wpon = posno1 then
| if strip$(tttxt002.kwd4) = str$(whinh431.wpon) then
item.shpe.txtn = tttxt002.ctxt
| endif
endif
endselect

after.shpm.copy.1: |#78562-1.sn
after.layout:
lattr.pageno = 0 |#78562-1.en



Thanks in advance.

Sangeeta

sam291091
14th October 2014, 11:32
Hello ,
You can use lattr.break
lattr.break : A boolean that is set to true during printing of before.field layouts when the layout is printed as the result of a sort field change. It is set to false when a before.field layout is printed because of a page break.

mark_h
14th October 2014, 15:59
Actually page() should work - you might need to adjust this, but the first thing I would do is remove everything after the "and" in the if statement. I am also not sure if you have to reset the lineno to 1 - I would leave it out and debug it. Make sure lineno gets reset.


before.shpm.copy.8:
before.layout:
if lattr.lineno >= 55 then
page()
lattr.lineno = 1
endif

sang1285
15th October 2014, 08:12
Thanks Mark and Sam for the replies but nothing seems to work.
Strange point is the lattr.pageno does not change after page().
Seems it is just passes through the page() command and do nothing.
Sounds very illogical.
if i forcefully increase lattr.pageno = lattr.pageno + 1 , the value is incremented correctly but in the output report i don't see the layout being printed on next page.

andreas.toepper
15th October 2014, 09:36
Does your problem occur only on the first page of a report, when using LN 10.2.1? So the page breaks will work fine on page 2 and all following pages, but on the first page of the report you can't force a page break?

I've had that one with LN FP8+, but could not find a working solution. I contacted inforXtreme and they declared it a feature, but did offer a workaround: "lattr.pageno > 1"used in the printcondition-field of the layout will suppress a layout on the first page.

sang1285
15th October 2014, 10:57
Thanks andreas ... i think thats the issue.
Page break does not work on first page.
(May be thats why we have lots of old reports with 1 page as blank ... was always wondering why was that ??)

Here is what i tried and it worked fine:
I just put a dummy layout in between teh layouts and put teh following condition for the layout:
Layout print condition : lattr.lineno >= 55 then

before.layout:
skip.to(spool.pg.length - 1)

This will alwyas print this layout at end of page
and the next layouts will automatically be printed on next page.


Thanks a Lot all of you :-)