Hi There, I want to print the barcode using navision report. I have tried it with using different fonts. It prints the bar code but when I try to scan those bar code. That doesn’t work. So, can anybody spread some lights that where I am going wrong. We are currently using Attain 3.6 version. The procedure I am currently following is like this : I have created a packing slip from the sales order and given it a number (This number I want to use as a bar code and to be printed on packing slip). Then I am passing this number to a BarCode management codeunit (Codeunit 11660). Which in turns give me some number. When I am printing that number in the report I have changed the font to “BC C128 HD Wide”. Any suggestion or help is appreciated Jag[?]
In order to be scanned successfully, printed bar codes must conform to a very specific set of specifications about the ratios of height to width, the ratios of the bars to the spaces, and the embedded check digits. The specs for each of these vary according to the particular bar code symbology chosen. Using a font through Windows with whatever printer is handy, may not work. Debugging the problem can be very time consuming. Worse yet, you may get your codes working initially only to later have the printed codes go out of spec, seriously impacting your production operation, perhaps at great cost in operating downtime. This is why I recommend use of third party software to print bar codes as good quality bar code printing packages has been thoroughly tested with all the brands and models of printers that it supports. If you cannot bring yourself to use a third party package, then I recommend you purchase verifier equipment to allow you to confirm that your printed bar codes meet specs. The third party software is cheaper than a verifier and can provide other capabilities, such as label design and compatibility with a wide variety of printers and symbologies. I recommend the third party software solution.
If you bought the font, then it comes with A COM obj which will transform the text to the specification be it U39 or code 128. Use the COM object in report to change the text to that format and print this new text. This way you don’t have to write the codeunit.
Ahmed’s comment may be appropriate for some sources of fonts, but not all font sources will provide such tools. In addition, tools such as the one Ahmed refers to may allow printing problems to arise again if the target printer is changed.
One thing you have to be sure of is if your printing the correct “format”. What I mean is if you’re using a truetype font for example the font will not generate the “start” or “stop” of the barcode. You have to do this yourself and this varies by barcode type. Some are easy (like in my example in the next paragraph) and some are not (like a UPC). I’ve been through this a couple of times and all fonts vary to some degree. The most common barcode format for internal use is Code 3 of 9. Every font I’ve used for “Code 39” always uses the same start/stop. You need to add an asterisk at the beginning and end of whatever you’re trying to print. For example, if you want to print a barcode for 12345 your output (you can even do this in Word as a test) would be 12345 this should make a scannable barcode for a code 39 font. You should have received some information with the fonts when you purchased them. I’ve found them to be a bit cryptic at first but once you get the hang of it you’ll be fine. One word of caution if you’re new to the barcode world. If you’re sending barcoded stuff to, let’s say, your customer make very sure your are sending a barcode format they require. Sound’s crazy but we distribute to retail customers and the fines for non-compliance can be very painful.
Ok…Now that I woke up and read the rest of your message I’ll expand a little and show you what you’re up against. I see that you’re trying to print a Code 128 barcode…yuck. Below is the code (please understand I’m not a programmer [:D]) that I wrote to generate an Interleaved 2 of 5 barcode. This will bear some resemblance to the problem you face. I2of5’s require the evaluation of “pairs” from the “sliced up” I2of5 number… Good Luck and may the force be with you IF IUoM.GET(itemNo,UoM) THEN BEGIN //find the correct record in Item Unit of Measure table I2of5Value := ‘’; X := 1; Y := 1; IF STRLEN(IUoM.“Std. Pack UPC/EAN Number”) = 14 THEN BEGIN REPEAT I2of5T[Y] := COPYSTR(IUoM.“Std. Pack UPC/EAN Number”,X,2); X := X + 2; Y := Y + 1; UNTIL Y = 8; END; X := 1; Y := 1; Tick := 146; IF STRLEN(IUoM.“Std. Pack UPC/EAN Number”) = 14 THEN BEGIN I2of5Value := INSSTR(I2of5Value,‘a’,1); REPEAT IF I2of5T[Y] = ‘00’ THEN I2of5T[Y] := ‘"]’; IF I2of5T[Y] = ‘01’ THEN I2of5T[Y] := ‘*J’; IF I2of5T[Y] = ‘02’ THEN I2of5T[Y] := ‘$J’; IF I2of5T[Y] = ‘03’ THEN I2of5T[Y] := ‘,I’; IF I2of5T[Y] = ‘04’ THEN I2of5T[Y] := ‘"Z’; IF I2of5T[Y] = ‘05’ THEN I2of5T[Y] := ‘*Y’; IF I2of5T[Y] = ‘06’ THEN I2of5T[Y] := ‘$Y’; IF I2of5T[Y] = ‘07’ THEN I2of5T[Y] := ‘"N’; IF I2of5T[Y] = ‘08’ THEN I2of5T[Y] := ‘*M’; IF I2of5T[Y] = ‘09’ THEN I2of5T[Y] := ‘$M’; IF I2of5T[Y] = ‘10’ THEN I2of5T[Y] := ‘1W’; IF I2of5T[Y] = ‘11’ THEN I2of5T[Y] := ‘9D’; IF I2of5T[Y] = ‘12’ THEN I2of5T[Y] := ‘3D’; IF I2of5T[Y] = ‘13’ THEN I2of5T[Y] := ‘;C’; IF I2of5T[Y] = ‘14’ THEN I2of5T[Y] := ‘1T’; IF I2of5T[Y] = ‘15’ THEN I2of5T[Y] := ‘9S’; IF I2of5T[Y] = ‘16’ THEN I2of5T[Y] := ‘3S’; IF I2of5T[Y] = ‘17’ THEN I2of5T[Y] := ‘1H’; IF I2of5T[Y] = ‘18’ THEN I2of5T[Y] := ‘9G’; IF I2of5T[Y] = ‘19’ THEN I2of5T[Y] := ‘3G’; IF I2of5T[Y] = ‘20’ THEN I2of5T[Y] := ‘%W’; IF I2of5T[Y] = ‘21’ THEN I2of5T[Y] := ‘-D’; IF I2of5T[Y] = ‘22’ THEN I2of5T[Y] := I2of5T[Y]::"'D"; IF I2of5T[Y] = ‘23’ THEN I2of5T[Y] := ‘/C’; IF I2of5T[Y] = ‘24’ THEN I2of5T[Y] := ‘%T’; IF I2of5T[Y] = ‘25’ THEN I2of5T[Y] := ‘-S’; IF I2of5T[Y] = ‘26’ THEN I2of5T[Y] := I2of5T[Y]::"'S"; IF I2of5T[Y] = ‘27’ THEN I2of5T[Y] := ‘%H’; IF I2of5T[Y] = ‘28’ THEN I2of5T[Y] := ‘-G’; IF I2of5T[Y] = ‘29’ THEN I2of5T[Y] := I2of5T[Y]::"'G"; IF I2of5T[Y] = ‘30’ THEN I2of5T[Y] := ‘5U’; IF I2of5T[Y] = ‘31’ THEN I2of5T[Y] := ‘=B’; IF I2of5T[Y] = ‘32’ THEN I2of5T[Y] := ‘7B’; IF I2of5T[Y] = ‘33’ THEN I2of5T[Y] := ‘?A’; IF I2of5T[Y] = ‘34’ THEN I2of5T[Y] := ‘5R’; IF I2of5T[Y] = ‘35’ THEN I2of5T[Y] := ‘=Q’; IF I2of5T[Y] = ‘36’ THEN I2of5T[Y] := ‘7Q’; IF I2of5T[Y] = ‘37’ THEN I2of5T[Y] := ‘5F’; IF I2of5T[Y] = ‘38’ THEN I2of5T[Y] := ‘=E’; IF I2of5T[Y] = ‘39’ THEN I2of5T[Y] := ‘7E’; IF I2of5T[Y] = ‘40’ THEN I2of5T[Y] := ‘"W’; IF I2of5T[Y] = ‘41’ THEN I2of5T[Y] := ‘*D’; IF I2of5T[Y] = ‘42’ THEN I2of5T[Y] := ‘$D’; IF I2of5T[Y] = ‘43’ THEN I2of5T[Y] := ‘,C’; IF I2of5T[Y] = ‘44’ THEN I2of5T[Y] := ‘"T’; IF I2of5T[Y] = ‘45’ THEN I2of5T[Y] := ‘*S’; IF I2of5T[Y] = ‘46’ THEN I2of5T[Y] := ‘$S’; IF I2of5T[Y] = ‘47’ THEN I2of5T[Y] := ‘"H’; IF I2of5T[Y] = ‘48’ THEN I2of5T[Y] := ‘*G’; IF I2of5T[Y] = ‘49’ THEN I2of5T[Y] := ‘$G’; IF I2of5T[Y] = ‘50’ THEN I2of5T[Y] := ‘2U’; IF I2of5T[Y] = ‘51’ THEN I2of5T[Y] := ‘:B’; IF I2of5T[Y] = ‘52’ THEN I2of5T[Y] := ‘4B’; IF I2of5T[Y] = ‘53’ THEN I2of5T[Y] := ‘<A’; IF I2of5T[Y] = ‘54’ THEN I2of5T[Y] := ‘2R’; IF I2of5T[Y] = ‘55’ THEN I2of5T[Y] := ‘:Q’; IF I2of5T[Y] = ‘56’ THEN I2of5T[Y] := ‘4Q’; IF I2of5T[Y] = ‘57’ THEN I2of5T[Y] := ‘2F’; IF I2of5T[Y] = ‘58’ THEN I2of5T[Y] := ‘:E’; IF I2of5T[Y] = ‘59’ THEN I2of5T[Y] := ‘4E’; IF I2of5T[Y] = ‘60’ THEN I2of5T[Y] := ‘&U’; IF I2of5T[Y] = ‘61’ THEN I2of5T[Y] := ‘.B’; IF I2of5T[Y] = ‘62’ THEN I2of5T[Y] := ‘(B’; IF I2of5T[Y] = ‘63’ THEN I2of5T[Y] := ‘0A’; IF I2of5T[Y] = ‘64’ THEN I2of5T[Y] := ‘&R’; IF I2of5T[Y] = ‘65’ THEN I2of5T[Y] := ‘.Q’; IF I2of5T[Y] = ‘66’ THEN I2of5T[Y] := ‘(Q’; IF I2of5T[Y] = ‘67’ THEN I2of5T[Y] := ‘&F’; IF I2of5T[Y] = ‘68’ THEN I2of5T[Y] := ‘.E’; IF I2of5T[Y] = ‘69’ THEN I2of5T[Y] := ‘(E’; IF I2of5T[Y] = ‘70’ THEN I2of5T[Y] := ‘!_’; IF I2of5T[Y] = ‘71’ THEN I2of5T[Y] := ‘)L’; IF I2of5T[Y] = ‘72’ THEN I2of5T[Y] := ‘#L’; IF I2of5T[Y] = ‘73’ THEN I2of5T[Y] := ‘+K’; IF I2of5T[Y] = ‘74’ THEN I2of5T[Y] := ‘!’; IF I2of5T[Y] = ‘75’ THEN I2of5T[Y] := ‘)[’; IF I2of5T[Y] = ‘76’ THEN I2of5T[Y] := ‘#[’; IF I2of5T[Y] = ‘77’ THEN I2of5T[Y] := ‘!P’; IF I2of5T[Y] = ‘78’ THEN I2of5T[Y] := ‘)O’; IF I2of5T[Y] = ‘79’ THEN I2of5T[Y] := ‘#O’; IF I2of5T[Y] = ‘80’ THEN I2of5T[Y] := ‘1]’; IF I2of5T[Y] = ‘81’ THEN I2of5T[Y] := ‘9J’; IF I2of5T[Y] = ‘82’ THEN I2of5T[Y] := ‘3J’; IF I2of5T[Y] = ‘83’ THEN I2of5T[Y] := ‘;I’; IF I2of5T[Y] = ‘84’ THEN I2of5T[Y] := ‘1Z’; IF I2of5T[Y] = ‘85’ THEN I2of5T[Y] := ‘9Y’; IF I2of5T[Y] = ‘86’ THEN I2of5T[Y] := ‘3Y’; IF I2of5T[Y] = ‘87’ THEN I2of5T[Y] := ‘1N’; IF I2of5T[Y] = ‘88’ THEN I2of5T[Y] := ‘9M’; IF I2of5T[Y] = ‘89’ THEN I2of5T[Y] := ‘3M’; IF I2of5T[Y] = ‘90’ THEN I2of5T[Y] := ‘%]’; IF I2of5T[Y] = ‘91’ THEN I2of5T[Y] := ‘-J’; IF I2of5T[Y] = ‘92’ THEN I2of5T[Y] := I2of5T[Y]::"'J"; IF I2of5T[Y] = ‘93’ THEN I2of5T[Y] := ‘/I’; IF I2of5T[Y] = ‘94’ THEN I2of5T[Y] := ‘%Z’; IF I2of5T[Y] = ‘95’ THEN I2of5T[Y] := ‘-Y’; IF I2of5T[Y] = ‘96’ THEN I2of5T[Y] := I2of5T[Y]::"'Y"; IF I2of5T[Y] = ‘97’ THEN I2of5T[Y] := ‘%N’; IF I2of5T[Y] = ‘98’ THEN I2of5T[Y] := ‘-M’; IF I2of5T[Y] = ‘99’ THEN I2of5T[Y] := I2of5T[Y]::"'M"; I2of5Value := INSSTR(I2of5Value,I2of5T[Y],X+1); X := X + 2; Y := Y + 1; UNTIL Y = 8; I2of5Value := INSSTR(I2of5Value,‘b’,16); Item.GET(itemNo); //find the record with the itemNo in the Item table END; //end IF STRLEN(IUoM.“Std. Pack UPC/EAN Number”) END; //end IF IUoM.GET
Scott makes his point very well. And he focused on only part of the problem. I maintain that you can buy a very good, general purpose bar code label design and printing package for under $1000US that supports a variety of different symbologies and different printers. The potential cost of bad bar codes is generally far in excess of $1000 (see Scott’s notes). If your time is valuable (and I’m sure it is), I recommend you seriously consider the third party package solution. And by the way of a disclaimer, I don’t have any interest in any third party package vendor.
Hi Dave! I both agree and disagree. Currently we’re using a 3rd party software package you describe. As a matter of fact, we got ours for free [;)] when we purchased a couple of high speed label printers. Our trouble is that we manage a couple thousand barcodes and occasionally an end-user selects the wrong file and prints an incorrect barcode. At some point we’re planning to integrate the label generation into Navision so that, when packaging product, an end-user will scan the production order they are working on and out will pop the correct barcode (actually multiple types) for the production run they are currently working on. I guess what I’m saying is that, depending on the situation (high volume/low volume) it may be worth the time investment to actually have Navision product the labels. The headaches of a 3rd package can sometimes out-weigh the benefits. Additionally, to support Dave and 3rd party package, keep in mind the report layout limitations of Navision. For example, we have a customer that requires a label with text rotated 90 degrees from the barcode (text down barcode accross) - Navision will not produce this.
Hi Scott, I think we mostly agree. I think the third party package should be relatively tightly integrated into Navision, not operating independently. I think that Navision should generate the data to be placed within the label and its barcode(s), but should pass that information interactively to the printing package. You can use any of a C/FRONT interface, ODBC interface, or ASCII file interface, depending on the capabilties of the package you’re using and the effort you want to expend to do the integration. I’ve done the ASCII interface approach (because it’s often the simplest approach) several times in such a way that the whole process looks to the user as though it were all happening within Navision. This way you can tightly control what bar code gets printed, which I think addresses the problem Scott has on occasion.
Specialised barcode printers are fine if all you want to print are labels but they don’t hack it if you want barcodes on paperwork such as production orders or delivery notes. That is when a TrueType font comes in handy. If Scott is going to show his then I’ll show mine (in a manner of speaking): Here’s some code that I use for interleaved 2/5 with the set of TrueType fonts I work with (from Datascan Font Service). Having checked to make sure the source string (SourceInt25) hasn’t got any non-numeric characters, you start on the optional checksum calculation: IF WithChecksum THEN BEGIN FOR i := 1 TO STRLEN(SourceInt25) DO BEGIN EVALUATE(v,COPYSTR(SourceInt25,STRLEN(SourceInt25)+1-i,1)); // Get digits from right to left IF (i + 1) MOD 2 = 0 THEN CT := CT + (3 * v) // “Even” position digits x 3 ELSE CT := CT + v; // “Odd” position digits END; CV := 10 - (CT MOD 10); // Subtract total from next multiple of 10 SourceInt25 := SourceInt25 + FORMAT(CV,1); END; IF STRLEN(SourceInt25) MOD 2 = 1 THEN // Add 0 for even length SourceInt25 := ‘0’ + SourceInt25; c := 211; // CP437: 211 CP850: 169 t1 := FORMAT(c,1); // Start bars FOR i := 1 TO STRLEN(SourceInt25) DO IF i MOD 2 = 1 THEN BEGIN // For each odd number EVALUATE(v,COPYSTR(SourceInt25,i,2)); // Take 2 digits CASE v OF // Convert digits to cipher value 0: c := 221; 1…94: c := v + 32; 95: c := 173; 96: c := 155; // CP437: 155 CP850: 189 97: c := 156; 98: c := 15; // CP437: 15 CP850: 207 99: c := 157; // CP437: 157 CP850: 190 END; t1 := t1 + FORMAT(c,1); END; c := 212; // CP437: 212 CP850: 238 t1 := t1 + FORMAT(c,1); // End bars Encoded := t1; The rest of the code then evaluates each pair of digits and converts them into a value that corresponds to the position of the relevant cipher in the font. Note that all teh comments about CP437 & CP850 are because the value sneed to change depending on the codepage in use on the client PC. Shove the codes for the start and end bars on the string and you are ready to print. As Scott says, just because you’ve got a font, doesn’t mean that you have to automatically get checksum calculations or the start/stop bars. Code128 is even more hairy because you have all the algorithms for minimising the code length. This is because C128 has three modes and a single barcode can switch between them (one has control characters and uppercase, one has upper & lower case and the third mode is double density numerics like I2/5). Very interesting area but also more complicated tahn meets the eye. Cheers, John
John also has good points, but to continue on my soapbox, a good bar code label printing software package is not limited to outputing only on specialized bar code printers. The ones I’ve used also support any of the standard HP PCL or PostScript compatible laser stryle printers and some ink jet printers as well. As to using bar codes within other documents (such as Physical Inventory Count Sheets or Manufacturing Routing Sheets/Work Orders), John has a good point. A true type font may be a good answer there. But you must be aware of the constraints of the bar code symbology in terms of the allowable size of the dark and light spaces and the resolution of the printer you are using, as well as other aspects of the combination of your symbology’s specification and all the components of your bar code system hardware. I once had the “interesting” experience of solving the problem created when a True Type font was used to generate 13,000 personal ID badges on a standard laser printer. The badges were laminated and handed out to 13,000 people to access a controlled facility. After handing out the badges, they found out the printer used to print the codes would print out-of-spec codes about 70% of the time (the problem was a combination of the physical dimensions of the bar code, the number of digits encoded, the symbology chosen, the resolution of the printer, and the type of toner used to print). In order to save face and avoid inconviencing 13,000 people, new much more expensive equipment had to be purchased to read the out-of-spec badges. Either way the one time cost of the problem was $10,000 to $20,000 (because they saved $400 in software). And they had tested a reasonable sample of the badges before going into production, but they used a shorter ID number for the tests than the production system generated. It can happen.
Concur, the whole point of barcodes is the distinction between light & dark so you need a good toner/ink in your printer to get the results. I started off with barcodes using a BBC Micro to print them on a Mannesmann Tally dot matrix printer. The program prepared a string of graphics commands for the printer in order to do the job. Using Code39, each cipher was about 1 cm wide! But they worked nicely as long as we didn’t let the printer ribbon get to worn. Fortunately, they just needed a batch for operator ID badges and about 1000 for the boxes that the work went round the factory in so they didn’t need to print them on a regular basis. Cheers, John
Hi, there are 2 very easy solutions: first, use the Barcode2Bitmap found in downloadsection. this is a wraper for a Barcodeocx. You call this tool with the desired meassurement of your barcode, the type and the content. it will save a bitmap on harddisk, which you might import to a BLOB in fin, and print this as a picture. You don’t need to store the bitmap in the database, but could. second: use a (better) kyocera. there you can print (formatet as Default) via the KPDL: !R!BARC xxxx!R!, refer to the xxx on the kyocera Manual. Kyo does even do the calculation of the Checksum for you (as the Barcode2Bitmap does).
Hi, to erverybody if anybody needs an example for barcode printing with code 128 B - 1 i can send it regards
Juergen, we are just about to embark on barcoding with Navision. It would be great to see an example of what you did. David, Thanks for driving your point home. I am feeling that Barcoding has been drastically over simplified in our approach and you have uncovered some great discussion points. MInd if I ask to get an example of one of these very cool 3rd party integration packages you meshed together? We will be deploying this on Attain 3.70 in Q1 or Q2 2004. My email address is in my profile. Thanks!
I just needed to print code 3 of 9 barcodes on all sales orders and purchase orders, My solution cost 10 bucks to implement and is working great. I got 4 modified cue cat (they where originally freebies handed out by a now defunct dot.com) scanners off ebay for $10, and a free “3 of 9” true type barcode font. Then on the sales order report I put a text field called barcode with the following expression: Barcode := ‘’ + “Sales Header”.“No.” + '’ The * is the start and end character for the 3 of 9 barcode I assigned the barcode font on the property page and all works great A simple solution, if you just need to print a simple barcode on existing reports It is an easy way to see if barcodes will work for you, without committing a thousands of dollars first. David Mavis
David is absolutly right , we have the same solution for barcode printing, just a font and the controlcharacters for start and end. but our problem was the usage on multilanguage ts-servers (in asia) and for this we had to buy a more expensive barcode-font (300$ for unlimited use) which was working under this configuration another point is the barcode-reader itself, you have to configure the reader if not a common barcode is used, verify that in the reader-manual Harry
I’ll say it again then I’ll shut up (this time anyway). If you use a quality third party label printing product, you can get a wide selection of bar codes (not just one) and compatibility with a variety of printers (both specialized and general purpose), as well as a host of additional capabilities, not the least of which is a label design tool. And often the quality of the printed bar codes is assured. All this typically for under $1,000 US. I recommend the third party tool approach.