How to create QR code in SSRS report in D365 F&O

 AxParadise.com

How to create QR code in SSRS report in D365 F&O

Even in the era of electronic reporting and PowerBI reporting, SSRS still plays a crucial role in D365 Finance & Operations ERP. SSRS report delivers most reports in ERP in a predefined format, which is beneficial for providing any legal document. For instance, a Legal invoice document containing a QR code has mandatory information specified by the government.

This article will explain how you can create QR codes in DP class and populate the same in the design part of the SSRS report.

Time needed: 30 minutes.

Create QR code

  1. 1. Create a new field in tmp table of the SSRS report

    Field type: Extends
    Extends: Bitmap
    TmpTableQRCodeBitmap


  2. 2. Create the below static function in the new QRHelper class

    public static container QRCode(Str _QRContents)
    {
    // QRContents is a formatted string provided as input to this function.
    // For example _QRContents= ?name='Customer name'&rr='RFCno'&tt='totalInvoiceAmount';
    System.Drawing.Bitmap bm = null;
    try
    {
    var qrCodeEncoder = new Encoder();
    bm = qrCodeEncoder.Encode(_QRContents);
    }
    catch (Exception::CLRError)
    {
    error(CLRInterop::getLastException().ToString());
    }
    using (var stream = new System.IO.MemoryStream())
    {
    bm.Save(stream, System.Drawing.Imaging.ImageFormat::Bmp);
    bm.Dispose();
    return Binary::constructFromMemoryStream(stream).getContainer();
    }
    }
    view rawQRHelper.cs hosted with ❤ by GitHub

  3. 3. Call above created function in DP class

    Provide formatted string for which QR code needs to be created and
    populate the tmp.QRCode =QRHelper::QRCode(_FormattedString)


  4. 4. Insert Image in RDLC design part of SSRS

    QRCodeImageRDLC


  5. 5. Build the project and deploy the report

    The report is now generated with a QR code.
    QRCodeSSRS

Ref :- https://axparadise.com/how-to-create-qr-code-in-ssrs-report-in-d365fo/

Comments

Popular posts from this blog

Customization on Sales invoice Report in D365 F&O

75) COC - Create a coc of the table modified method

46) D365 FO: SHAREPOINT FILE UPLOAD USING X++