web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to create QR code barcode and print on SSRS report in Dynamics Ax?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

There is Fixed assets bar codes report. It is showing barcodes but want to generate and show QR codes. 

There is a post explaining how to generate QR code.
https://community.dynamics.com/ax/f/33/t/137647

Anyone know how to take it to the SSRS report?

Thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rana Anees Profile Picture
    1,813 on at

    Got it. Here is the code. 

    Add a field to your temp table of type Container. 

    In your SSRS report place image and set Source Database, Your new container field and MIME type image/bmp. 
    AssetBarCodeDP -> processReport()

    public void processReport()
    {
        AssetTable assetTable;
        QueryRun queryRun;
    
        Filename            filename;
        FileIOPermission    perm = null;
    
        AssetBarCodeContract contract;
    
        contract = this.parmDataContract() as AssetBarCodeContract;
    
        barcodeSetup = BarcodeSetup::find(contract.parmBarCodeSetUpId());
        barcode = barcodeSetup.barcode();
        queryRun = new QueryRun(this.parmQuery());
    
        qrCode = new Microsoft.Dynamics.QRCode.Encoder();
        binData = new BinData();
    
    
        while (queryRun.next())
        {
            assetTable = queryRun.get(tableNum(AssetTable)) as AssetTable;
            assetBarCodeTmp.AssetId = assetTable.AssetId;
            assetBarCodeTmp.AssetName = assetTable.Name;
            assetBarCodeTmp.BarCode = this.barCode(assetTable.Barcode + assetTable.Name);
    
            netBitmap   = qrCode.Encode(assetTable.Barcode +' '+ assetTable.Name);
            filename    = qrCode.GetTempFile(assetTable.Barcode +' '+ assetTable.Name);
            perm        = new FileIOPermission(filename, 'RW');
            perm.assert();
    
            binData.loadFile(filename);
            assetBarCodeTmp.QRCode = binData.getData();
    
            assetBarCodeTmp.insert();
    
            //if(WinAPI::fileExists(filename))
            //{
                //WinAPI::deleteFile(filename);
            //}
    
            CodeAccessPermission::revertAssert();
        }
    }
    

    SSRS QR Code Image
    QR-Code.png
    Final
    QR-Code.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans