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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans