web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / NAV-real-life / Barcode, Picture and 2 colu...

Barcode, Picture and 2 columns list with NAV

joemarselo Profile Picture joemarselo 366

In this case, I create a report with barcode and picture to generate Product Catalog, or other say Price List, Price Tag, which actually a page contain Product Code, Product Name/Description, Product Prices, Product Picture, and Barcode of Product Code.

This is the report preview:

This is how we create the report:

Data Item : Item – i1
Global Barcode39   Record   Barcode39   
bar1        Record   Object   
bar2        Record   Object   
path1       Text     200
i2          Record   Item   
ln          Integer

The left column uses data item ‘Item’ – i1. The right column uses global variable ‘Item’ – i2.
First we copy the filters applied to i1. When first line is drawn, make i2 to go to next record. At the time i1 = i2, means, skip it since it can create duplication.

i1 – OnPreDataItem()
Barcode39.SetDPI(60, 4500, 900);
Barcode39.AddQuiet(TRUE);
i2.COPYFILTERS(i1);

i1 – OnAfterGetRecord()
IF i1."No." = i2."No." THEN CurrReport.SKIP;
IF ln MOD 10 = 0 THEN CurrReport.NEWPAGE;
ln += 1;
i2.GET(i1."No.");
i2.NEXT;

i1, Body (1) – OnPreSection()
IF EXISTS (path1 +i1."No."+’.bmp’)
   THEN i1.Picture.IMPORT(path1 +i1."No."+’.bmp’,FALSE)
ELSE;
Barcode39.MkBarcode(FORMAT(i1."No."),bar1,TRUE);

IF EXISTS (path1 +i2."No."+’.bmp’)
   THEN i2.Picture.IMPORT(path1 +i2."No."+’.bmp’,FALSE)
ELSE;
Barcode39.MkBarcode(FORMAT(i2."No."),bar2,TRUE);

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Thanks to Mibuso and Robert de Bath for Barcode39 object. You can go to mibuso.com , download section, and search for Barcode38, or just follow this link.

The object originally was created to use CodeUnit. Since I prefer to use Table, I made a small change to move all codes in the original codeunit and put in my new table.


Filed under: Computers and Internet, NAV

This was originally posted here.

Comments

*This post is locked for comments