rduncan10
20th March 2014, 19:11
I have a report that is normally printed two-sided. I have a request to change the report so that the main group always starts on a new page, so that each group can be separated.
I thought the code below might work, but it doesn't. The idea is to check when the group field changes, and check to see if the report is currently on the back of the page (the page # will be an even number). If it is, it should skip a page.
string old.maingroup.field(20)
before.maingroup.field.1:
before.layout:
if maingroup.field <> old.maingroup.field then
old.maingroup.field = maingroup.field
if(lattr.pageno \ 2) = 0 then
page()
endif
endif
One thing I noticed right away is that lattr.pageno actually shows the previous page number when the main.group changes. I tried changing the code to “if(latter.pageno + 1)\2) = 0 then”, but this didn’t work either.
I also tried adding this to the after.layout section, and adding two page() commands, but those didn't work either.
Thanks
I thought the code below might work, but it doesn't. The idea is to check when the group field changes, and check to see if the report is currently on the back of the page (the page # will be an even number). If it is, it should skip a page.
string old.maingroup.field(20)
before.maingroup.field.1:
before.layout:
if maingroup.field <> old.maingroup.field then
old.maingroup.field = maingroup.field
if(lattr.pageno \ 2) = 0 then
page()
endif
endif
One thing I noticed right away is that lattr.pageno actually shows the previous page number when the main.group changes. I tried changing the code to “if(latter.pageno + 1)\2) = 0 then”, but this didn’t work either.
I also tried adding this to the after.layout section, and adding two page() commands, but those didn't work either.
Thanks