Blogs about barcode printing with Axapta usually same each other. There are some problems with Axapta barcode printing and none of them mentioned these problems. I wrote tricks about them at this page:
Code 128:
display BarCodeString ServiceObjectbarCode()
{
Barcode barcode;
;
barcode = BarcodeCode128::construct();
barcode = Barcode::construct(BarcodeType::Code128);
barcode.string(true, ServiceObject.ItemSerialNum);
barcode.encode();
return barcode.barcodeStr();
}
After drag and drop this display method to report section:
Font - BC C128 Narrow
Width - This value shouldn't be auto.
Axapta terminate label before needed length. Needed length can find with a few try. I used 10 cm with my sample.
Fontsize - 24 (I couldn't success write readable barcodes below 24.
Some bigger font sizes cannot read with barcode reader too, need tries).
Code 39 :
display BarCodeString ServiceOrderbarCode()
{
Barcode barcode;
;
barcode = Barcode::construct(BarcodeType::Code39);
barcode.string(true, ServiceOrder.ServiceOrderId);
barcode.encode();
return barcode.barcodeStr();
}
Font - BC C39 3 to 1 HD Wide
I didn't have trouble when using Code39 about width property when selected Auto. Like Code 128 I had trouble with font sizes below 24 and some sizes upper 24. It may be about my barcode reader.