web
You’re offline. This is a read only version of the page.
close
Skip to main content
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,378

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)
  • faiz7049 Profile Picture
    2,378 on at
    RE: How do I generate QR code to Sales invoice report

    Hi Experts,

    Issue has been resolved after restart the AOS.

    Thanks,

    Faiz

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: How do I generate QR code to Sales invoice report

    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,378 on at
    RE: How do I generate QR code to Sales invoice report

    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
    Hossein.K Profile Picture
    6,648 on at
    RE: How do I generate QR code to Sales invoice report

    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.

  • huijij Profile Picture
    19,811 on at
    RE: How do I generate QR code to Sales invoice report

    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

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 756 User Group Leader

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 514 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans