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

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

  • faiz7049 Profile Picture
    faiz7049 2,107 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
    ergun sahin 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
    faiz7049 2,107 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
    Hossein.K 6,646 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
    huijij 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans