Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How do I generate QR code to Sales invoice report

(0) ShareShare
ReportReport
Posted on by 1,915

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 1,915 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,812 Super User 2024 Season 1 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 1,915 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,642 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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans