IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#47991 - 05/21/14 09:17 AM Add a previous record field to current
tsacg Offline
OL Guru

Registered: 02/19/03
Posts: 133
Loc: Florida

I have a form that prints 45 records N-up per data page. N-up is set to change data page with each repeat. The data is attached to the form to split data pages after 45 records.

Each record has a field with a "quantity". I would like to figure out how to print the total of all previous "quantity" on each record.

For example
The first 3 records "quantity" are
31
150
250
I would like to print "quantity" and totals from each previous record.
31 (31)
150 (181)
250 (431)

Top
#47996 - 05/21/14 10:12 AM Re: Add a previous record field to current [Re: tsacg]
JFLAIR
Unregistered


tsacg,

You will need to create a Global variable, in your case I called it Total which is define as an Integer and where the default value is set to 0.

then in a PressTalk object:
Code:
&Total:=&Total+strtoint(trim(@(1,1,3)))
show(trim(@(1,1,3))+ ' ('+inttostr(&Total)+')')


Where @(1,1,3) is the data location of the print quantity.

Hope this helps.
Regards,
JF

Top
#47998 - 05/21/14 10:34 AM Re: Add a previous record field to current [Re: tsacg]
tsacg Offline
OL Guru

Registered: 02/19/03
Posts: 133
Loc: Florida
Thank you JFLAIR! I will give that a try.

Top
#48002 - 05/21/14 10:57 AM Re: Add a previous record field to current [Re: ]
tsacg Offline
OL Guru

Registered: 02/19/03
Posts: 133
Loc: Florida
That worked great! Thank you!
I just had to convert it for use with database emulation.

Quote:
&Total:=&Total+strtoint(field('CountOfDistrict',1))
show(field('CountOfDistrict',1)+ ' ('+inttostr(&Total)+')'

Top