Blocks Command: counter

Modified on Thu, Dec 9, 2021 at 12:53 PM

Counter can is used to create different records of the same document based on values entered. As an example, it can be used to print cheque numbers. To the user, this command will display two text boxes, one labeled ‘from’ the other ‘to’. There is another option to enter a third text box for ‘step’, by default, the value of step is 1. Total number of records for step=1 is equal to the absolute value of from subtracted from to plus 1.

As an example: from=1 to to=10 will generate 10 - 1 + 1=10 records (assuming step=1)

Command Name: counter

Command Value:

Properties (default)

Description

from=1

Default from field value

to=1

Default to field value

min=0

Minimum value applies to both from and to fields

max=0

Maximum value applies to both from and to fields

minfrom=0

Minimum value applies to from field

maxfrom=0

Maximum value applies to from field

minto=0

Minimum value applies to to field

maxto=0

Maximum value applies to to field

step=1

Counter step value, defaults to 1

showstep=false

Show or Hide step control (default false)

format=""

Format of the generated number. # will be replaced by a number if exists otherwise empty, 0 will also be replaced by a number otherwise 0 will appear.

Examples:

format=00000 value of 25 will be displayed as 00025

format=##### value of 25 will be displayed as 25

All other characters will display as is.    

records=10

or

maxrecords=10

Maximum proof records regardless of the from and to values (default=10)

layout=0

0 for showing from, to and step on separate lines (default)

1 for showing from, to and step on the same line

2 for showing labels on top of fields all in one row new   

fromlabel="From"

Optional label for from field

tolabel="To"

Optional label for to field

steplabel="Step"

Optional label for step field

order=0

Important when more than one counter is on the page, this will decide the sequence of numbering.

 

Note: 

  1. Using double quotes (") is optional unless the value contains spaces. For example:

       format=00000 is valid format="00000" is also valid

       format="00 00 0" is valid, format=00 00 0 is not valid

 

  1. From value can be greater than to value to print records in reverse order, the step will be adjusted internally to a negative number.
  2. When more than one counter block exists on the page then the number of records will be the multiplication of all.

 

 

Number of records when there are more than one counter

Counter1      from=1 to=10 order=1 format=0000

Counter2      from=10 to=15 order=2 format=000

 

Total number of records    = (10-1)+1 * (15-10)+1

                           = 10 * 6

                           = 60

Order values will generate records as such

Record        Counter 1     Counter 2

1             0001          010

2             0001          011

3             0001          012

4             0001          013

5             0001          014

6             0001          015

7             0002          010

 

If order is reversed, that is order=2 for counter1 and order=1 for counter2 then

Record        Counter 1     Counter 2

1             0001          010

2             0002          010

3             0003          010

4             0004          010

5             0005          010

6             0006          010

7             0007          010

8             0008          010

9             0009          010

10            0010          010

11            0001          011

 

 

 

 

 

Note:

To use Serialization set the from parameter to auto and the to parameter to the suggested number of records.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article