MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Issues, Questions, Etc. (http://forums.pti.com/forumdisplay.php?f=40)
-   -   Multiple fields in data matrix (http://forums.pti.com/showthread.php?t=4429)

benjaminleebates January 11th, 2016 02:01 PM

Multiple fields in data matrix
 
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.

Alex Marshall January 11th, 2016 02:17 PM

Re: Multiple fields in data matrix
 
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.

benjaminleebates January 11th, 2016 02:24 PM

Re: Multiple fields in data matrix
 
Interesting...
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...


All times are GMT -7. The time now is 11:40 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.