tion1976
15th September 2023, 19:00
Hi,
I have a problem with a report with many layouts.
I have more before.field and they show on page #2 however the footer does not make it to show.
Somehow i figured out that I need to get to the next page by calling either page() or to.page(3). However, the remaining before.field layouts do not show even if i set the expression lattr.pageno=3
If I set the expression to the first I want to appear on page #3 it is displayed on page #1.
I am not sure that page() is the same Next page checkbox on layout attributes.
before.orco.43:
before.layout:
if cntr=1 then
lattr.print = false
endif
|#14092023.sn
|after.layout:
| if cntr=2 then
| to.page(3)
| lattr.pageno = 3
| endif
|#14092023.en
before.orco.44:
before.layout:
|message("cntr %d", cntr)
if cntr=1 then
lattr.print = false
endif
|#14092023.sn
if cntr=2 then
| message("page %d", lattr.pageno)
to.page(3)
| lattr.pageno = 3
lattr.print = true
Recap... I need to print the footer on every page.
How do i do that?
mark_h
19th September 2023, 16:37
Well - I am missing something. If you add a footer layout to the report it should print every page. Now you can use certain things - like output expression to only print footers under certain conditions. So what am I missing? I am not sure you need the page commands at all.
tion1976
22nd September 2023, 10:14
The issue was there were too many lines to print on that second page of report and not break the page. The content on that page was updated and it was twice as before.
With the updated content I had 5 layouts each of 22 lines.
What it worked for me:
1) I set Next page checkbox in the report layout #4 (out of those 5) and set output expression to be lattr.pageno>2
Also, I set the same output expression to be lattr.pageno>2 on the report layout #5 but no check on Next page.
2) On the report properties I set Foot margin 1 (instead of -1) and Page Length 70 (instead of -1). I noticed that before I had 3x22=66 lines on page.
I am not sure if page() and to.page(3) would have been worked on before.orca.44
BTW what is the difference between page and to.page ?
bdittmar
22nd September 2023, 11:01
Hello,
Report script functions
The statements programmed in a report script section consist of a combination
of 3GL programming language features: overview and the following 4GL report functions:
layout.again() Evaluate and print layout again.
need( expr ) Force a page break if the number of free lines is less than expr.
page() Start a new page.
reset.suppress() It is possible to suppress printing a value when it is the same as
the previous value. You can use this function to suppress the value once (that is, for one value).
skip( expr ) Skip expr number of lines before printing the next layout.
skip.to( expr ) Skip to the line number indicated by expr. Intervening lines are left blank.
If the specified line number is less than the current page number, a new page is started.
to.page( expr ) Start a new page with number expr.
You cannot use need(), page(), skip(), skip.to(), or to.page() in header and footer layouts.
Regards
tion1976
22nd September 2023, 11:57
Having lattr.pageco = 2 if i code to.page(16) in report script, does it create all the pages from the cuurrent (3) to 16 ?
I am not clear how useful is to use to.page rather than page? What is the use case for these functions?
mark_h
22nd September 2023, 18:45
I always used page(). To page would start renumbering the pages so if you printed 3 pages and then had to.page(5) it would start a new page with 5. So you would have page numbers 1,2,3,5,...... All to.page does is start a new page numbers. The benefit of this is lets say you were printing 3 purchase orders - each time you hit a new purchase order you could say to.page(1) and the second purchase int he range would start with page number 1 and same for the 3rd order(how ever many you printed). Never did it myself, but can see how that can be helpful.
OmeLuuk
23rd September 2023, 22:42
I think you would have to play with the need setting on the report to account for the max length of the footer, making sure the report breaks its stream to place the footer on each page. No need for (programmatically) messing with page or to.page imho.