View Full Version : Remove digits to make Barcode
Danovh
May 22nd, 2009, 12:53 PM
I need to make a USP-A Barcode, but the data file has 2 extra digits at the end.
How do I set a Rule to remove those digits at the same time making the USP-A Barcode and what font to be used?
esmith
May 26th, 2009, 04:53 AM
The easiest method is probably to use the USPA Barcode Rule built into FP. Select your field(s) for creating the code and use the default font, AdvFIM, then click the "Convert to JavaScript" button. Edit the second to last line which reads:
final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(MakeUPCABarcode(retstr)) + '</span>';
to instead read:
final_data = '<span><f name="' + Var6 + '">' + NormalizeEntities(MakeUPCABarcode(Left(retstr,11)) ) + '</span>';
I added the "Left" function to trim the final variable to 11 digits -- the default number of digits for a valid UPCA barcode (the MakeUPCABarcode rule generates the 12th check digit).
Danovh
May 26th, 2009, 08:08 AM
Thanks, that worked except for the font. IDAutomationUPCEAN is what I used.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.