Trust ID PBCEX logo 300x102

Can a storage item be used as a counter for each record ?

12 years 3 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Topic Author
Can a storage item be used as a counter for each record ? #414
Is it possible to set a storage item to update a column for individual records in an Excel spreadsheet ?
We have an Excel spreadsheet supplied by a customer for a large Bureau print job (10,000) cards.
As part of this we need to update the spreadsheet with an issue number for each person, so to start with these will all be 1. However if a person has already had a card printed this needs to update to be 2, and so on.

In the storage item I tried setting the "use as counter" option, but the spreadsheet was not updated.

Is this possible the way we need to do it ?

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
12 years 3 months ago
Sergio Agostinho
Administrator
Administrator
Posts: 508
More
Can a storage item be used as a counter for each record ? #421
I think you're looking for a print log.
Please check this topic about "How to create a print log" at the link below
http://cardexchange.eu/viewtopic.php?f=18&t=84

Regards
Sergio

With best regards
Sergio Agostinho
12 years 3 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Topic Author
Can a storage item be used as a counter for each record ? #422
Thanks Sergio,

This is kind of what we need but not quite, the number that is stored back needs to be an issue number so "1" "2" "3" etc..
This number is also used as part of a barcode string on the card so it needs to be exact.
Also as the records are printed in batches this issue number needs to be incremented by 1 each time that a record is printed.

I do not see any option for this, but any I would be happy to try any other ideas you may have.

Thanks,

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
12 years 3 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Can a storage item be used as a counter for each record ? #423
Hi Craig,

If I understand your first post correctly, you just want to have a storage item with the "use as counter" option and it seems you have configured it correctly. This option should work normally form Excel, so I think some other problem is going on. Please, note that storage items are only updated when printing. If the update is not done correcty, it might help tohave a look at the DataExchange.log, to see what update command CardExchange has sent to Excel.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
12 years 2 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Topic Author
Can a storage item be used as a counter for each record ? #490
Thanks Rutger,
Not sure why it wasn't working but in the end we swapped to an Access database and it works fine.
One problem we have though is that we are using this counter as an issue number that is also going to be printed on the card. Unfortunately as the storage item is the last thing to be done the number in the database field is not the one that will be printed.

Do you know of any way around this ?
Is there a way to have another field that we can print that could read the database column and add 1 to the value before printing ?

Any ideas would be welcome :)

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
12 years 2 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Can a storage item be used as a counter for each record ? #492
Hi Craig,

For any database column that is used as a counter, it is advisable to make sure that there default value is 0. This ensures that immediately after creation of a new record, the column already contains a valid number. Since the counter is only updated after printing, you will have to increment the number by one to print it on the card. This can be done by using a formula similar to the one velow in the text object on your card design:
[<IssueNumber> + 1]
where IssueNumber is the variable that you mapped to the corresponding field in the database.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
12 years 2 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Topic Author
Can a storage item be used as a counter for each record ? #503
Thanks Rutger,

Could this be done for Magnetic and Barcode items as well ?

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
12 years 2 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Can a storage item be used as a counter for each record ? #504
Hi Craig,

In a text object you can embed expressions in the text by using square brackets. For a barcode object, the value is always given as an expression. So you can simply type <IssueNumber> + 1 in the expression box of the barcode editor.

For magnetic data, the situation is somewhat different. If you enable magnetic encoding in the first page of the card-definition wizard and map the tracks in the second page, there is no possibility to do a calculation like incrementing the value of a database field. But fortunately, there is a workaround. Please, follow the steps below:
  • Do notenable magnetic encoding in the card-definiton wizard
  • To encode for example track 1, create a text object with the following text in it: ~1%[<IssueNumber> + 1]?

As you can see, the text box contains the start and stop codes for magnetic encoding. These are the same ones as specified in the printer options and depend on the type of printer you use. Althoufg this test will be visibe on the preview, it will not be printed. The printer interprets tha text as magnetic encoder commands and will do the magnetic encoding.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)
12 years 2 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Topic Author
Can a storage item be used as a counter for each record ? #505
Thanks Rutger,

There is always a way around things :)

Can you do concatination in this way as well ?
For example ~1%[<IssueNumber> + 1 <IdNumber>]?
Or is concatination only possible through the mappings window ?

Thanks again.

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
12 years 2 months ago
Rutger Koperdraad
Platinum Boarder
Platinum Boarder
Posts: 1566
More
Can a storage item be used as a counter for each record ? #506
For concatenation within an expression, you have to ecplicitly convert the numbers to strings and concatenate them with the '+' operator:
[IntToStr(<IssueNumber> + 1) + IntToStr(<IdNumber>)]
An easier alternative is using two expressions in the same text object:
[<IssueNumber> + 1][IdNumber]
The latter option can only be used for text objects. For barcodes you have to use the first option.

Rutger Koperdraad
Senior Software Engineer

"A reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. All progress, therefore, depends on the unreasonable man." (Bernard Shaw)