How to Create Barcode of the Invoice Number and display it in the Header of the Report in RDLC.

In this blog, we will learn how to Create a displayed barcode in RDLC Report.

So basically, the barcode is a way of representing the data in form of lines. Any Alpha-Numeric string can be encoded into a barcode and displayed. For encoding, we have Interface in Business Central.

We will be creating a sales report in this blog.

This is the Format of the sales report.

So, let us see what coding we needed to do for encoding the sales invoice number.

In the On After Get Record trigger we are encoding the sales invoice number. The interface ‘Barcode Font Provider’ is predefined in Business Central.

And an Enum is needed to encode the barcode which is used to define the 1-dimension or 2-dimension barcode we need to create. Here we are using a 1D barcode. And another Enum will show the Babar code symbology of Code39. It is used for alphanumerical strings.

We then pass the Invoice number and the dimension Enum to Validate function which checks if the given data is valid for creating the barcode with the given symbology.

And after validating we then pass the variables to Encode font Function for encoding.

After the Encoding is completed, the encoded text is sent with the dataset to RDLC.

As you can see above the barcode textbox is created inside the rectangle and is hidden. Which is getting the data from business central. And a new textbox is created in the header and enter this expression in the textbox =ReportItems!<textboxname>.Value

And the font for the barcode display will be IDAutomationHC39M.

After that, we will compile and run the report. The barcode will be visible in the header of the report.

Afroz Labbai 

D365 Business Central

Addend Analytics

Addend Analytics is a Microsoft Gold Partner based in Mumbai, India, and a branch office in the U.S.

Addend has successfully implemented 100+ Microsoft Power BI and Business Central projects for 100+ clients across sectors like Financial Services, Banking, Insurance, Retail, Sales, Manufacturing, Real estate, Logistics, and Healthcare in countries like the US, Europe, Switzerland, and Australia.

Get a free consultation now by emailing us or contacting us.