Global Counter

210 views
Skip to first unread message

JordiB

unread,
Feb 9, 2022, 12:55:56 PM2/9/22
to XMPie Interest Group
Hi,

I am  checking in uDirect plugin a new feature that allows us to manage some variables for current page (state.pageIndex ), total number of pages (state.pageCount), and for ADOR values (state.adorValue)..... and it expects a Javascript function:

For example:

return state.pageIndex + " of " + state.pageCount;
  
Using this new feature,  is there a way to create a global counter to be increased in every page of the whole job  and write it in every page ? 

For example, a job with three records with different number of pages

Record1    Record2     Record3
1,2,3         1,2,3,4,5       1,2

The global counter would be 
1,2,3,4,5,6,7,8,9,10 

  Thanks.

couch

unread,
Feb 9, 2022, 3:38:49 PM2/9/22
to XMPie Interest Group
That is exactly what state.pageIndex is.

Jordi Bolos

unread,
Feb 10, 2022, 3:00:51 AM2/10/22
to xmpie...@googlegroups.com
Hi,

state.pageIndex is reset to "1" when I new record starts.  I want a variable/funcion to be increased in every page of the job ( with no reset at the beginning of every record and convert it to QR ).  Like numbering the whole job in QR format. 

--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xmpie-users/c87bb79c-dfc4-4ced-97b3-63305334c1e5n%40googlegroups.com.

couch

unread,
Feb 10, 2022, 5:19:48 PM2/10/22
to XMPie Interest Group
Sorry, I misunderstood what you want when seeing the example at the bottom.

All ADOR and state information is reset at the start of processing each record in the database. You don't have access to localstorage or cookies since you are not working in a browser. So, you are stuck.

The only thing I can think of is to create a uPlan extension to do it - in which case you would simply "call" your dll in a text ADOR object to place it on the page. 

Another alternative is to log a feature request.

Jordi Bolos

unread,
Feb 11, 2022, 4:25:09 AM2/11/22
to xmpie...@googlegroups.com
Hi, 
I suppose you need uPlan for a "Plan Extension" ?  
Do you have an  example about how to use "uPLan Extension" or I can find it in XMPie campus ?

Thanks.

   

couch

unread,
Feb 13, 2022, 5:09:30 PM2/13/22
to XMPie Interest Group

Amit Cohen

unread,
Feb 15, 2022, 11:11:11 AM2/15/22
to XMPie Interest Group
Hi,

I do not see how a QLingo extension will help, as QLingo can't know the count of pages per recipient, it is pre-document composition. hence sadly it sounds like a dead-end to me.
I'm not sure it will help, but you can have an ADOR with the number of records using the QLingo 'GetEnv("CurRecordNumber")', this value can be accessed as (state.adorValue) and be used to generate a QR code that encapsulates both the recipient index and the page index\count, this is not exactly what you wanted, but is a piece of information that might help you achieve what you want at the end of the line.
if that does not help, I presume you'll need to raise a feature request.

eko...@gmail.com

unread,
Mar 22, 2022, 1:11:26 PM3/22/22
to XMPie Interest Group
Wouldn't this do the trick?
GetEnv("CurRecordNumber")

couch

unread,
Mar 22, 2022, 4:50:31 PM3/22/22
to XMPie Interest Group
Hi Ed, The CurRecordNumber gets the counter of the database record and if you have a static number of pages, you can do some math in uPlan to get you the page index of the whole print job, but when you have a variable length document (eg page visibility or autoflow) then the plan interpretation happens before document composition, so the plan never knows how many pages each recipient will have.

Anyway, I have exciting news on this front - the page numbering text / page numbering barcode feature will have a small enhancement in version 11.2 which will resolve this problem - stay tuned...

Jim B

unread,
Apr 8, 2022, 1:41:50 PM4/8/22
to XMPie Interest Group

We call a stored procedure via uPlan.   If you want unique numbers, make sure to put your stored procedure inside a transaction block, otherwise you get funky results.
Reply all
Reply to author
Forward
0 new messages