Showing posts with label QR Code. Show all posts
Showing posts with label QR Code. Show all posts

Wednesday, June 8, 2016

Add a QR Code to a Dynamics NAV 2015/2016 in Report Header

Add a QR Code to a Dynamics NAV 2015/2016 in Report Header
Hi All,
This article will demonstrate how to add a QR Code to a NAV 2016.

For this example I have made a copy of the Order Confirmation Report (ID 205) and save it as QR Order Confirmation (ID 50023).

I have redirected the Company Information Picture field in the report to point to a new BLOB field in the Sales Header Table (ID 36) called “QR Code”.

Note: If you need QR Code Generator Solution Objects, Then ping me, It's free of cost available for learning purpose.
Step 1:  Open Sales Header Table [ID 36] and Add fields [see the bellow screenshot].


After Added fields add some code in OnInsert trigger [see the bellow screenshot].



Step 2:  Create a new codeunit for ”QR Code” functionalities.
                In my case i seted the property Table No with value  ”Sales Header”,
        [ See the bellow screenshot].





In this Codeunit i wrote  four functions for relating QR Code, i.e.
1.       CreateQRCodeInput
2.       GetQRCode
3.       GetBarCodeProvider
4.       MoveToMagicPath

 See the bellow screenshot of full ”QR  Code Management” Codeunit C/AL Code.





Step 3:  Create a Report, In my case i made Save as of Report ID 205 ” Order Confirmation”.
                In that i made some changes:
1.       QRCodeManagement varible of Codeunit of 50010 ” QR Code Management” that earlier created.
2.       Added Data item fields for getting the QR Code Image from Sales Header [See the screenshot].





3.       Add couple of lines in ”Sales Header” OnAfterGetRecord Trigger, to run the ”QR Code Management” Codeunit  and get the QR code image from ”Sales Header” Table [see the bellow screenshot].





Step 4:  Open Report Layout design and create a Image control in Report Header, In my case i used earlier company logo field and populate with new QR fields that i created in Report dataitem [see the bellow screenshot].




After changes save report and exit.

Step 5:  Run the report that you created with require filters [see the bellow screenshot].








Popular Posts