Jump to content

Variable 2D Barcode


INGuser

Recommended Posts

I am trying to use the following barcode rule to make a barcode on the first page of each packet.

 

barcodeData = Field("Demand Feed");

barcodeData += "0";

sheetCnt = Field("Page Count");

barcodeData += FormatNumber("00", sheetCnt);

recNum = Field("Packet #");

barcodeData += FormatNumber("000000", recNum);

var DMbarcode = new DataMatrixBarcode;

DMbarcode.pointSize = 3;

DMbarcode.preferredFormat = 7;

return (FieldChanged("PacketKey"));

DMbarcode.Make(barcodeData);

 

 

Every time I try to validate this it returns either a true or false value instead of the 2D barcode that is needed. I want the barcode to show up on the first page of each packet when the packet number changes.

 

Thank you for your help in advance.

Link to comment
Share on other sites

I don't know anything about 2D barcodes but I noticed that you are returning a value for if the field PacketKey was changed. Maybe make the return an if statement saying if the field packetkey changed then return the barcode

 

if ((FieldChanged("PacketKey")))

return DMbarcode.Make(barcodeData);

Link to comment
Share on other sites

Jon is right. The return line is returning 'true' or 'false' based on whether or not the field value for "PacketKey" changed. You should edit your code to look like this:

barcodeData = Field("Demand Feed");
barcodeData += "0";
sheetCnt = Field("Page Count");
barcodeData += FormatNumber("00", sheetCnt);
recNum = Field("Packet #");
barcodeData += FormatNumber("000000", recNum);
var DMbarcode = new DataMatrixBarcode;
DMbarcode.pointSize = 3;
DMbarcode.preferredFormat = 7;
return (FieldChanged("PacketKey")) ? DMbarcode.Make(barcodeData) : "";

Edited by step
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.

Guest
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...