Hi,
In part of designing barcoded form, we will extract the data using handheld scanner to excel file or notepad.
Can we determine the field sequence of extracted data (output) in the form designer?
Need your kind advise for this matter
Thanks,
Raja
Solved! Go to Solution.
Views
Replies
Total Likes
Raja,
Here is a simple example of a custom barcode encoding of a PaperFormsBarcode using a pipe-delimiter.
The text field 'Barcode encoding' contains the value of the PaperFormsBarcode object. It is a useful debugging technique.
The calculate event on the PaperFormsBarcode object does the encoding.
// form1.page1.subform1.barcode::calculate - (JavaScript, client)
if (xfa.host.version < 7.05) {
this.rawValue = " ";
}
else {
this.rawValue = encodeBarcode();
}
function encodeBarcode() {
// define barcode variables
var firstName;
var lastName;
var address1;
var address2;
var city;
var state;
var zipCode;
// check First Name for null
if (form1.page1.subform1.firstName.isNull) {
firstName = "";
}
else {
firstName = form1.page1.subform1.firstName.rawValue;
}
// check Last Name for null
if (form1.page1.subform1.lastName.isNull) {
lastName = "";
}
else {
lastName = form1.page1.subform1.lastName.rawValue;
}
// check Address for null
if (form1.page1.subform1.address1.isNull) {
address1 = "";
}
else {
address1 = form1.page1.subform1.address1.rawValue;
}
// check Address for null
if (form1.page1.subform1.address2.isNull) {
address2 = "";
}
else {
address2 = form1.page1.subform1.address2.rawValue;
}
// check City for null
if (form1.page1.subform1.city.isNull) {
city = "";
}
else {
city = form1.page1.subform1.city.rawValue;
}
// check State for a null selection
if (form1.page1.subform1.state.isNull) {
state = "";
}
else {
state = form1.page1.subform1.state.rawValue;
}
// check ZIP Code for null
if (form1.page1.subform1.zipCode.isNull) {
zipCode = "";
}
else {
zipCode = form1.page1.subform1.zipCode.rawValue;
}
// build barcode string for encoding
var str = firstName + "|"
+ lastName + "| "
+ address1 + "| "
+ address2 + "| "
+ city + "| "
+ state + "|"
+ zipCode;
// return the encoding string
return (str);
}
Steve
Views
Replies
Total Likes
Yes. Use a custom script to encode the barcode.
Steve
Views
Replies
Total Likes
Thanks for the tip
Really appreciate if you can show us example or screenhots of the process.
Raja
Views
Replies
Total Likes
Raja,
Here is a simple example of a custom barcode encoding of a PaperFormsBarcode using a pipe-delimiter.
The text field 'Barcode encoding' contains the value of the PaperFormsBarcode object. It is a useful debugging technique.
The calculate event on the PaperFormsBarcode object does the encoding.
// form1.page1.subform1.barcode::calculate - (JavaScript, client)
if (xfa.host.version < 7.05) {
this.rawValue = " ";
}
else {
this.rawValue = encodeBarcode();
}
function encodeBarcode() {
// define barcode variables
var firstName;
var lastName;
var address1;
var address2;
var city;
var state;
var zipCode;
// check First Name for null
if (form1.page1.subform1.firstName.isNull) {
firstName = "";
}
else {
firstName = form1.page1.subform1.firstName.rawValue;
}
// check Last Name for null
if (form1.page1.subform1.lastName.isNull) {
lastName = "";
}
else {
lastName = form1.page1.subform1.lastName.rawValue;
}
// check Address for null
if (form1.page1.subform1.address1.isNull) {
address1 = "";
}
else {
address1 = form1.page1.subform1.address1.rawValue;
}
// check Address for null
if (form1.page1.subform1.address2.isNull) {
address2 = "";
}
else {
address2 = form1.page1.subform1.address2.rawValue;
}
// check City for null
if (form1.page1.subform1.city.isNull) {
city = "";
}
else {
city = form1.page1.subform1.city.rawValue;
}
// check State for a null selection
if (form1.page1.subform1.state.isNull) {
state = "";
}
else {
state = form1.page1.subform1.state.rawValue;
}
// check ZIP Code for null
if (form1.page1.subform1.zipCode.isNull) {
zipCode = "";
}
else {
zipCode = form1.page1.subform1.zipCode.rawValue;
}
// build barcode string for encoding
var str = firstName + "|"
+ lastName + "| "
+ address1 + "| "
+ address2 + "| "
+ city + "| "
+ state + "|"
+ zipCode;
// return the encoding string
return (str);
}
Steve
Views
Replies
Total Likes
wow, great! thanks a lot.
After determining the sequence in the form, can I determine the sequence for the output after handheld scanner reads it? (excel file/ notepad format)
Raja
Views
Replies
Total Likes
Yes. The output from a handheld will be exactly the same format as the format encoded in the barcode.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies