Generating barcode for SSRS report

Variant 1, based on parameters:
    BarcodeSetupId  barcodeSetupId;
    BarcodeSetup    barcodeSetup;
    Barcode         barcode;

    BarCodeString encodeBarcode(Str _barcodeValue)
        if (barcodeSetup.validateBarcode(_barcodeValue))
            barcode.string(true, _barcodeValue, BarcodeContentType::Item);
            throw(error(strfmt("@SYS41409", barcode.barcodeType(), _barcodeValue)));
        return barcode.barcodeStr();

    // Init barcode
    barcodeSetupId  = InventParameters::find().BarcodeSetupIdPick;
    barcodeSetup    = BarcodeSetup::find(barcodeSetupId);
    barcode         = barcodeSetup.barcode();
    if(barcodeSetup.BarcodeType != BarcodeType::NoBarcode)
        // Check font parameters

    encodeBarcode("packing12345"); // encode string to barcode, should be printed at report to display barcode
Variant 2, specific barcode type:

    BarcodeCode128      barcode128 = BarcodeCode128::construct();

    barcode128.string(true, salesTable.ReturnItemNum);
    barcode128.barcodeStr(); // returns encoded string of barcode, should be printed at report to display barcode
    //barcode128.barcodeStrHR(); // returns human readable string
In SSRS report use relevant font at the control which should display barcode for case above BC C128 should be used.

If you experience problems with barcode appearence in PDF you can use following checklist:


About is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags