Smiffy
1st May 2002, 13:56
I have created some reports which print barcode representations for employees, status codes etc.
The barcode printing is possible by selecting font Large 10cpi & barcode 19. I haven't printed barcodes before, so I am not aware at this stage if this is the baan standard way of acheiving a barcode print.
I have a need to represent a field of 20 characters. The problem is that when we exceed 15 characters (alphabetic) the report aborts. However, 20 characters numeric is fine. Is there a reason for this, is there a way around the problem ?
Also I wish to represent a tab character as the last character of the field. This is to force baan to tab to the next field when scanning in these barcodes. I'm sure this is possible. Anyone done this?
thanks
shah_bs
3rd May 2002, 07:20
I will give a bare-bones version of how I did it, and if you think that is the way to go, I will try and fill in more details (as much as I can - this was done a couple of years back for a customer and I do not have access to the documentation):
Here's what I did:
(The printer is an HPLJ4000 Laserjet printer, enabled to print barcodes by having a SIMM/DIMM card installed - this being done by the hardware experts. The bar-code type was Code 128).
- Get a printout from the printer of the 'Font List'. This gives me the escape sequences of the barcode fonts that the printer is capable of printing.
- Copy the nearest Printer Information driver file (eg. hp_lj4) and modify the pfont3 to pfont16 (as necessary) to represent the various heights of the barcode font, using the escape sequence from the above printout.
- Write a library function that will accept the field to be 'barcode printed' as a string and return back a 'padded' string which will be printed on the report layout. The padding consists of a Start Byte, the Stop Byte and a Check Digit, with the original string sitting between the start and stop bytes. (The writing of the library function may not be necessary depending on the details of your environment.)
- customize the program script and the report layout to make use of the above facilities.
Let me know if you think more details will help.
shah_bs
10th May 2002, 07:11
Be nice to know how you are printing your barcodes.
Smiffy
16th May 2002, 13:58
I set my reports up with the fields for barcode printing set up as 10cpi & 19 as the barcode type. We are limited to a field size of 15 characters, but that is okay.
I have put controls in the software so that only uppercase can be used for aplha fields. This is because, the barcodes do not successfully scan in when there are too many characters that are lowercase. This is because the lines in the barcode are numerous and come out too grey if lowercase letters are used. We are also looking at setting up a new user font that is bigger than 10cpi, to make the barcodes bigger.
To get a tab at the end of the field, we simply use chr$(9).
e.g.
emno.c1 = STR$(tccom001.emno) & chr$(9)
This tab means that the rest of the field cannot exceed 13 chars
shah_bs
17th May 2002, 04:54
So you did not have to write a routine to tack on the START character, STOP character and a check digit around the field you are printing. Very fortunate!
What printer and related software are you using?
{Mine was an HPLJ 4000 and the font loaded were Code 128 barcode fonts. I also modified the routine to handle the HPLJ5000 Line Printer (the START character was the same and the check digit formula was the same, but it required TWO STOP Characters!). }
The TAB thing is unique, I must remember the trick.
I am still puzzled by the 15 character limit you mention. I have printed 32 character Item Codes in barcode font (on the above printers) and there has been no problem. The only problem I had with numeric fields was that the barcode would not scan if there were leading spaces in the number, a problem easily fixed by printing leading zeroes instead.