Jump to content

Multiple fields in data matrix

Recommended Posts

So I am attempting to create Data matrix barcodes. I need the code to have four fields from a spreadsheet in each code, with a comma between each piece of data. An example of the code to be encode would be "2,25,62076,3" without the quotes of course...

Each of these values are being pulled from a different field (column) and the comma does not exist in the csv file.

Any help would be greatly appreciated.

Link to comment
Share on other sites

Creating a Data Matrix barcode is simple. You have to know which encoding mode you need and use it in the script.

Here is the syntax:


return MakeDataMatrixBarcode(DataToEncode, ProcessTilde, EncodingMode,PreferredFormat, PointSize, NoFontTag, Font)


So click “Create Rules>>New(text)>>>Empty Rule. Give the Rule a name.

Enter the code. Change the fieldname to match your data file.


var dataforbarcode = Field(“mydatafield”);//etc…

var dmbarcodeobj = new DataMatrixBarcode;

dmbarcodeobj.encodingmode = "base256";

dmbarcodeobj.pointSize = 12;

return dmbarcodeobj.Make(dataforbarcode);


• Data – The data that will be encoded. This can be one or more fields from your data, a result of another rule, etc.

• Process Tilde – When set to "true", the format ~ddd is used to specify the ASCII code ofthe encoded character. For example, if the following text is entered in the Data field,

~029AB it will be encoded as GSAB where GS is a delimiter ASCII 29 character. This can be used in a single string to encode GS and RS characters (GS = ASCII 29 and RS =ASCII 30). Other commonly used ASCII codes are ~009 for a tab and ~013 which is a return function. These are useful when encoding multiple fields in a single symbol. Thedefault is false.

• Encoding Mode –

There are four encoding methods:

• ASCII – encodes data that contains the first 128 ASCII characters.

• C40 – encodes data that contains numeric and upper case characters.

• TEXT –encodes data that contains both numeric and lowercase characters.

• BASE256 – encodes 8 bit values.



Now insert this Rule from the “Variable” drop box in the Variable Text Editor.

Do not apply the font. The script will return the font. Test and compose.

Link to comment
Share on other sites


I'm sure my attempt is not as elegant, but it got the result...

return MakeDataMatrixBarcode(Field("Station1") +"," +Field("Quantity1") +"," +Field("Item1") +"," +Field("Building1"), null, null, null, 10)

Could you tell me if your code has something needed that mine does not? I don't want to crash and burn half way thru composing a file...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...