Not able to scan Barcode, generated by AX

Dear All,

The barcode generated using Ax is not being detected by the barcode scanner. I have bought a barcode scanner yesterday and tested it on various price labels, it was working fine but it not able to scan the barcode generated by the AX .

I have used the folowing 2 codes yet it was not working

Display str ShowBarcode()
{
BarcodeCode128 MyBarcode;
;
MyBarcode= BarcodeCode128::construct();
MyBarCode.string(true,InventTable_1.ItemId);
MyBarCode.encode();
return MyBarCode.barcodeStr();
}

Display str ShowBarcode_1()
{
return “"+strupr(InventTable_1.ItemId)+"”;

}

Please help guys…is it the printer issue because the barcode scanner (Symbol) works fine since i have tested.???

Hi,

I’ve got the same problem, in the BarCode128 Class, in the EncodeString() method, replace the code as follow: replace rtint = 1 where rtint = 95

if (shift)
{
if (codeset == #CodesetA)
rtnint = (tcchr <= 31 || tcchr > 127) ? #NotFound : tcchr - 31; // is tcchr in codeset B?
else
{
rtnint = (tcchr < 0 || tcchr > 127) ? #NotFound : (tcchr <= 31) ? tcchr + 65 : tcchr - 31; // is tcchr in codeset a
if (charVal == 32)
{
//rtnint = 95
rtnint = 1;
}
}
shift = false;
}
else
{
if (codeset == #CodesetA)
{
if (tcchr == 32)
//rtnint = 95
rtnint = 1;
else
rtnint = (tcchr < 0 || tcchr > 127) ? 96 : (tcchr <= 31) ? tcchr + 65 : tcchr - 31; // is tcchr in codeset a
}

Regards,

Thomas

Hi Thomas,

Thanks for a quick reply. I tried what you have suggested, but still it’s not working. Do we have to use any specific printers or something i mean the type???

Regards,

kaushik

Hi Kaushik,

I don’t think you have to specify the printer, it may be the size of you barcode, I forgot to specify it yesterday, in the class declaration of barcode128 class,

declare the following: #Define.MaxReturnStringSize(200), we had problems with the size of the barcode, in our case we couldn’t encode more than a 25 char string.

in the fetch() method of our report it’s like this:

barCodeValue = “uuiiiooppp”;

barcode128 = barcode::construct(barcodeType::Code128);
barcode128.string(true, BarCodeValue,barcodeContentType::Undefined);

I declared in the class declaration of my report:

BarcodeSetup barcodeSetup;
BarcodeCode128 barcode128;

and it works for me but we had a lot of problems as I said with size of barcode. How long is the string you want to encode?

Try with a small string and tell me.

Regards,

Thomas

Hi Thomas,

I did what u said, it’s still not working. Do we have to use special bar code printers to print barcode…??

Regards,

kaushik

you don’t need to have a special BarCodePrinter, the class Barcode128 take a string and generate the barcode, the barcode object of our report is a string with the a datamethod that returns barcode128.barcodeStr(), I remember there was also problems with font, we use BC C128 HD Medium with font size 80, make a few tests and let me know

Regards,

Thomas

Hi,

I worked on similar requirement some time ago. Based on memory, try adjusting the font size and see whether that helps. In our case, we had to print the barcode and scan it on two different printers - an industrial and normal printer. Once we got the right font size (after many trials), we were able to print and scan in both printers.

Hi Harish,

Could you provide a proper font and font size combination which worked for you???

I tried almost all the barcode fonts and font size combination.

Regards,

kaushik

Hi,

You only have to increase the ExtendedDataType (BarCodeString) in property change stringSize 400.

I am using the string is 26 char.

Regards,

Hi Roman,

Thanks for the reply, I had figured it out long back. It is working fine now. I used a similar font property which worked.

Regards,

kaushik

Hi,

Yes, this will fix the space issue, but try to encode string containing uppercase,lowercase letter,numbers and space - it even doesn’t read. This thing fixed me only the space issue in string containing uppercase letters, numbers and space. Do you know how to fixed the first problem?