Skip to Content
0
Jun 23, 2015 at 06:12 PM

Duplex Terms & Conditions with Groups and multiple varied pages per group

39 Views

I've been searching for three weeks and have tried many combinations.

I have an existing purchase order that groups on a field called REFNUM.

The grouping and paging along with "Page N of M" has been working fine.

Now the customer requested that Terms and Conditions (T&C) print on the back of every page (so every EVEN page).

I have gotten closest by putting the T&C in the Page Header, with conditional suppression of odd pages and even pages.

I have reviewed other posts so I know I am not the only one trying to do this?

The problem I now have is getting the "Page N of M" to behave properly.

I can get the PO to print "REFNUM (Continued)" on any of the follow-on ODD pages for a given group.

To do that I am using a formula called @REFNUMSUFFIX (and appending it to the REFNUM field in a text box on GH1)

WhilePrintingRecords;

StringVAR MyPage;

IF NOT OnFirstRecord

THEN MyPage:="Continued";

IF PREVIOUS({Command.REFNUM})={Command.REFNUM}

THEN

"-" & MyPage

Else ""

I tried the following to get a page # for that group, but it is not behaving as I want it to - it seems to be using boolean logic and giving me either a 1 or a 0 instead of a number:

WhilePrintingRecords;

NumberVar MyPage;

IF OnFirstRecord

THEN MyPage:= 1

ELSE

IF PREVIOUS({Command.REFNUM})={Command.REFNUM}

THEN

MyPage:= MyPage+1;

"-" & ToText((int(MyPage/2))-0)

Please let me know if you need more information.