RedHeadedStepITChild
IS-IT--Management
Hello all,
I hope this post finds you all well.
I am using Crystal v.11. Connected via ODBC to a DB2 database on an AS400 v.5 r.3.
In the past we have used a report that I created to print out for inventory tags, which were manually filled out by the counters. This year we are attempting to use a barcode reader, which will capture data so that we can send it back to the ERP. So, in preparation for that I have taken the same report and added a field formatted as Code39 barcode. It is a formula that concatenates multiple fields from the DB. The problem is that one of the fields is not a set length, and for our parsing program to work correctly, it needs to be.
Example of the output as I have it now:
*1BT1012PS*
The *'s are the start/stop for the barcode readers
The first 1 is the tag number
BT1012 is the item number - (this field needs to be 10 characters long no matter the length in the DB)
PS is the warehouse location.
Here is the formula that I am attempting to use to add leading zeros to the item number:
StringVar itemNumber;
numberVar counter;
For counter := 0 to (10 - length({ICTL02.CTPROD})) do
(
itemNumber := 0 & {ICTL02.CTPROD}
);
itemNumber
The ICTL02.CTPROD is the item number field in the DB.
The output of this formula for the particular example posted above is 0BT1012 - so it looks like it is going through the loop once, but will not iterate.
Any ideas?
Best regards,
Jason
I hope this post finds you all well.
I am using Crystal v.11. Connected via ODBC to a DB2 database on an AS400 v.5 r.3.
In the past we have used a report that I created to print out for inventory tags, which were manually filled out by the counters. This year we are attempting to use a barcode reader, which will capture data so that we can send it back to the ERP. So, in preparation for that I have taken the same report and added a field formatted as Code39 barcode. It is a formula that concatenates multiple fields from the DB. The problem is that one of the fields is not a set length, and for our parsing program to work correctly, it needs to be.
Example of the output as I have it now:
*1BT1012PS*
The *'s are the start/stop for the barcode readers
The first 1 is the tag number
BT1012 is the item number - (this field needs to be 10 characters long no matter the length in the DB)
PS is the warehouse location.
Here is the formula that I am attempting to use to add leading zeros to the item number:
StringVar itemNumber;
numberVar counter;
For counter := 0 to (10 - length({ICTL02.CTPROD})) do
(
itemNumber := 0 & {ICTL02.CTPROD}
);
itemNumber
The ICTL02.CTPROD is the item number field in the DB.
The output of this formula for the particular example posted above is 0BT1012 - so it looks like it is going through the loop once, but will not iterate.
Any ideas?
Best regards,
Jason