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.
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].
Great article, after reading this feeling proud.
ReplyDeletehiii,
ReplyDeletei have write the same code ,my report is working fine but QR Code is not showing in header only showing cross mark.
Can you please share your report at mcabinesh@live.com,so i can check.
DeleteHii,
DeleteI have a the same problem, how did you resolve it?
Hi,
ReplyDeleteI am not getting this dotnet variable(IBarcodeProvider) in NAV 2016 and getting in Navision 2013. I need it in nav 2016. Please suggest the way. Thanks in advance.
In Data Type Choose DotNet and then click on SubType
ReplyDeleteThen Click on Assembly, then click on Server tab and choose
Microsoft.Dynamics.Nav.MX
After clicking OK, choose Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider
I have an error can't serialize an instance of the following .Net framework object: assembly Microsoft.Dynamics.Nav.Mx...
ReplyDeleteMicrosoft.Dynamics.Nav.Mx.BarCodeProviders.QRCodeProvider
Hi,
ReplyDeleteYou get this error if you assign a server-side object to a client-side object and vice versa. So check, if all variables have set property RunOnClient to true.
I'm guessing that you didn't set RunOnClient property to Yes for local variable QRCodeProvider in function GetBarCodeProvider(). Both IBarCodeProvider and QRCodeProvider shoud have the same property.
Really I enjoy your site with effective and useful information on
ReplyDeletedynamics nav support
A call to System.__ComObject.MoveFile failed with this message: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED) Iam getting this error while running the report
ReplyDeleteThank you, Can you please send me the example object of QR Code management?
ReplyDeleteHI I HAVE TRIED THE CODE BUT FACING THE BELOW ERROR
ReplyDeleteMicrosoft Dynamics NAV
---------------------------
A call to Microsoft.Dynamics.Nav.MX.BarcodeProviders.IBarcodeProvider.GetBarcode failed with this message: Cannot create barcode.
Parameter name: barcodeInput
---------------------------
OK
---------------------------
It's very nice of you to share your knowledge through posts. I love to read stories about your experiences. They're very useful and interesting. I am excited to read the next posts. I'm so grateful for all that you've done. Keep plugging. Many viewers like me fancy your writing. Thank you for sharing precious information with us. Best Upc Barcodes For Sale service provider.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteKindly help me to Add QR Code in POSPrint Utility
ReplyDeletehello Binesh, can you provide the qr code provider objects please ?
ReplyDeletethis is my email, hamed.elarnaout@gmail.com
Could you please send me the QR Code Objects.
ReplyDeleteCould you please send me the QR Code Objects. My e-mail address is emackietx@gmail.com
ReplyDeleteHi - can you please share the QR Code Generator Solution Objects with me? mariam.it.1900@gmail.com
ReplyDeleteThanks in advance!
how to do it in Business Central Cloud (without using any dotnet variable).
ReplyDeleteThanks For Sharing, We make the technology much simpler and Grow your business with our QR Rocket.
ReplyDeleteVisit https://qrrocket.com/!