Jump to content

Barcode rule?


Mark

Recommended Posts

I have a job with delivery point barcode info in the database.

Problem is when I use the "postnet barcode" rule there is a big gap between the frame bars and the 5+checksum codes but not 5+4+deliverypoint+checksum codes.

 

The "barcode" rule using <zipcode> from the database looks good (no gap) but the post office bounced it and said it had no check digit.

 

What is the proper rule to use for a deliverypoint barcode with a mix of 12 and six character codes?

Thanks,

Link to comment
Share on other sites

I have a job with delivery point barcode info in the database.

Problem is when I use the "postnet barcode" rule there is a big gap between the frame bars and the 5+checksum codes but not 5+4+deliverypoint+checksum codes.

I'm not sure the problem can be analyzed just from your description. You can collect up a sample job that demonstrates the problem and send it to Support.

The "barcode" rule using <zipcode> from the database looks good (no gap) but the post office bounced it and said it had no check digit.

Well, the obvious question is, are you computing the check sum? The template rule gives an option to not include it, but I'm not sure that the barcode is valid without it. I'd just use a simple JavaScript rule. (See below.)

What is the proper rule to use for a deliverypoint barcode with a mix of 12 and six character codes?

Thanks,

Something like this:

var barcode_data = Field("Zip") + Field("DeliveryPoint");
return '<f name="AdvPNET">' + MakePostNetBarcode(barcode_data);

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Same problem as first post. There is a big gap between the frame bars and the zip portion of the barcode with 5 codes but not 5+4 codes when using Postnet Barcode Rule. Data file has a field for the "delivery point barcode" but no "zipcode" by itself this time.

Gave up and used a mailing machine last time.

Link to comment
Share on other sites

I have found a solution for this problem and have been using it for a few months now. here is the script that i use.

 

var barcode_data = Field("ZIP Code") + Field("Delivery Point");

postnet= '<f name="AdvPNET">' + MakePostNetBarcode(barcode_data);

BCode = Left(postnet, Len(postnet)- 2) + ")" ;

return BCode

make sure "treat returned strings as tagged text" is checked.

 

This rule deletes the extra zero off the end and adds a ")" to complete the barcode.

If you have any questions let me know.

Link to comment
Share on other sites

  • 2 weeks later...

I keep getting an error that the input string can only contain numbers.

Data field has colons at beginning and end of delivery point barcode (to make the barcode frame?) Do I have to go into the excel file and strip them out? Your rule I edited is below.

 

var barcode_data = Field("DeliveryPointBarcode");

postnet= '<f name="AdvPNET">' + MakePostNetBarcode(barcode_data);

BCode = Left(postnet, Len(postnet)- 2) + ")" ;

return BCode

Link to comment
Share on other sites

Try this. This will get rid of the colon on each end of your delivery point as well as construct the barcode.

 

Var1 = Right(Field("YourField1"), Len(Field("YourField1"))-1)

Var2 = Left(Var1, Len(Var1) -1);

 

var barcode_data = Field("ZIP Code") + Var2;

postnet= '<f name="AdvPNET">' + MakePostNetBarcode(barcode_data);

BCode = Left(postnet, Len(postnet)- 2) + ")" ;

return BCode

Insert you delivery point field in "YourField1" obviously.

The first two lines will delete the first and last character of that field (which would be those colons if i am understanding you right)

 

Let me know if it works ok.

Link to comment
Share on other sites

  • 4 weeks later...

Got cut off for some reason:

 

There is not a "zip code" field in this excel file, so I get an error.

If I put "DeliveryPointBarcode" in I get the error that it can only contain numbers.

 

Do i need to add zipcode to the excel file?

And if so, do you know an easy way to do that?

 

Thanks

Link to comment
Share on other sites

Got cut off for some reason:

Please feel free to edit your post instead of starting a new one.

There is not a "zip code" field in this excel file, so I get an error.

If I put "DeliveryPointBarcode" in I get the error that it can only contain numbers.

 

Do i need to add zipcode to the excel file?

And if so, do you know an easy way to do that?

Jordanh was just sharing an example from his job with a different data field. Just change the name to your data field, and use a replace to strip the non-numeric characters:

var barcode_data = Field("DeliveryPointBarcode");
return '<f name="AdvPNET">' + MakePostNetBarcode(barcode_data.replace(/\D/g, ""));

Link to comment
Share on other sites

I realize that he was showing an example. I'm saying that the excel file has no entry for a zip code by itself. Its only lumped in with "deliverypointbarcode" and "citystatezip" so i was wondering if I need to make the zip code it's own entry in excel.

 

Being new to the rule making in FusionPro I'm not sure if I should just be copying what is posted here and pasting it into the rule editor (with edits of course). Or is there another way I should be doing this?

Link to comment
Share on other sites

I realize that he was showing an example. I'm saying that the excel file has no entry for a zip code by itself. Its only lumped in with "deliverypointbarcode" and "citystatezip" so i was wondering if I need to make the zip code it's own entry in excel.

Well, it depends on what's in the data field now. If your data field already contains both the ZIP code and the delivery point, then you don't need to separate them out. Just pass the entire data field to the MakePostNetBarcode function, after doing any necessary cleansing to remove non-numeric characters as in my previous post.

Being new to the rule making in FusionPro I'm not sure if I should just be copying what is posted here and pasting it into the rule editor (with edits of course). Or is there another way I should be doing this?

No, you should be able to copy-and-paste the code posted here right into the Rule Editor.

Link to comment
Share on other sites

  • 5 months later...

Never got the results I wanted with any of these barcode rules mentioned above.

By the way, is there a way to save a rule for other jobs to use?

 

It turns out if I remove the colons ( : ) , in Excel, around the delivery point barcode coming from the mailing software and replace it with asterix (*) the spaces go away. I also don't need to use a rule, so the extra zero problem isn't an issue.

I've printed up some more tests for the post office and I am awaiting the results.

Link to comment
Share on other sites

Never got the results I wanted with any of these barcode rules mentioned above.

You also never followed my suggestion to collect up a sample job that demonstrates the problem and either post it here or send it to Support. Without seeing exactly what you're doing, it's hard to analyze exactly where it's going wrong. So, we're all just kind of guessing.

By the way, is there a way to save a rule for other jobs to use?

Yes. You can create a function which can be copied-and-pasted, either into a rule or into the JavaScript Globals. Or you can import the Data Definition. Or you can create an external .js script file and place it in the Plug-Ins folder; please see the FusionPro Rules System Guide for more information on this.

It turns out if I remove the colons ( : ) , in Excel, around the delivery point barcode coming from the mailing software and replace it with asterix (*) the spaces go away. I also don't need to use a rule, so the extra zero problem isn't an issue.

I've printed up some more tests for the post office and I am awaiting the results.

I'm glad you got it working. As Mark Hilger alluded to, if you already have the data encoded, you don't need to call the MakePostNetBarcode function; you can just place the encoded data in the AdvPNET. However, that font has very specific requirements for what it can encode; basically only numbers and parentheses.

 

Also, it's worth noting that the USPS is phasing out POSTNET barcodes in favor of the new Intelligent Mail Barcode standard.

Link to comment
Share on other sites

I'm new to the variable world and mailing so it's a little confusing, you'll have to pardon my ignorance. I plan to go through the Rules guide but finding free time is difficult in a production environment. Put out one fire and on to the next.

If it was known colons don't work, why wasn't that fix suggested when the fact that there were colons in the field came up?

Thanks for all the help, hopefully as I do more of this it will start to sink in.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...