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

How do I generate QR code to Sales invoice report

(0) ShareShare
ReportReport
Posted on by 2,382

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,382 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,382 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

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans