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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How do I generate QR code to Sales invoice report

(0) ShareShare
ReportReport
Posted on by 2,430

Hi Experts,

By below code QR code is generated on Form grid whenever I type any text in Description field.

How to generate QR code in Sales invoice report.

Please guide me. I check processreport method in SalesInvoiceDP but there is only super method.

In QR code, I need to add Customer Name, Customer Code and Total Amount.

QR.jpg

public void modified()
{
    BinData binData = new BinData();
    Image Imgobj;
    System.Drawing.Image img;
    System.Drawing.Bitmap obj;
    FilePath _path;
    MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();

    super();

    obj = new System.Drawing.Bitmap(encoder.Encode(SampleQRCode.Description));
    obj.Save(@"C:\newPhoto.bmp",System.Drawing.Imaging.ImageFormat::get_Bmp());

    _path="C:\newPhoto.jpg";
    img = new System.Drawing.Bitmap(obj);
    binData.loadFile(@"C:\newPhoto.bmp");
    SampleQRCode.QRCode=binData.getData();
}

Thanks,

Faiz

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi,

    To generate QR Code on Sales Invoice and add Customer Name, Customer Code and Total Amount

    you may add parameters to System.Drawing.Bitmap() like 

    System.Drawing.Bitmap(encoder.Encode(CustomerName" "Customer Code" "TotalAmount));

    https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/292311/qr-code-in-ax-2009/839395

    regards

  • Suggested answer
    Hossein.K Profile Picture
    6,648 on at

    Hi,

    Did you find the report and data source of it. in this data source there is a init or execute method to write your code.

  • faiz7049 Profile Picture
    2,430 on at

    Hi Experts,

    I have created Display() method under table custInvoiceJour as given below.

    display container qrcode()
    
    {
    
            Bindata bindata = new Bindata();
    
            Image Imgobj;
    
            System.Drawing.Image img;
    
            System.Drawing.Bitmap obj;
    
            Filepath _path;
    
     container con;
    
    str Qty,InvDate,GRate,CustName,CustNumber,GTot,PONo;
    
    MessagingToolkit.QRCode.Codec.QRCodeEncoder encoder = new MessagingToolkit.QRCode.Codec.QRCodeEncoder();
    
    ;
    
      CustNumber=this.custTable_InvoiceAccount().AccountNum;
        CustName=this.custTable_InvoiceAccount().name();
    
        obj = new System.Drawing.Bitmap(encoder.Encode(CustNumber " " CustName));
    
        obj.Save(@"C:\temp\newPhoto.bmp",System.Drawing.Imaging.ImageFormat::get_Bmp());
    
    bindata.loadFile(@"C:\temp\newPhoto.bmp");
    
    con = bindata.getData();
    
    return con;
    }

    And New Field created under SalesInvoiceTmp 'QRCode' type container(ExtendedDataType=Bitmap). then in report class salesInvoiceDP I added 

       if (_custInvoiceTrans)
        {
            salesInvoiceTmp.LineHeader = this.parmLineHeader();
        }
    
        //custInvoiceTrans
        salesInvoiceTmp.Name = _custInvoiceTrans.Name;
        SalesInvoiceTmp.QRCode=_custInvoiceJour.qrcode();
        salesInvoiceTmp.Qty = _custInvoiceTrans.Qty;

    dispay qrcode method in insertIntoSalesInvoiceTmp(). and added to Report.

    When I run it. Getting error

    Error-CLR.jpg

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Did you try "Microsoft.Dynamics.QRCode.Encoder"

    community.dynamics.com/.../how-to-create-qr-code-barcode-and-print-on-ssrs-report-in-dynamics-ax

  • faiz7049 Profile Picture
    2,430 on at

    Hi Experts,

    Issue has been resolved after restart the AOS.

    Thanks,

    Faiz

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 653

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 501 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 298

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans