INGuser Posted January 6, 2014 Share Posted January 6, 2014 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. Quote Link to comment Share on other sites More sharing options...
jwhittaker Posted January 6, 2014 Share Posted January 6, 2014 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); Quote Link to comment Share on other sites More sharing options...
step Posted January 6, 2014 Share Posted January 6, 2014 (edited) 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 January 6, 2014 by step Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.