5 Replies Latest reply on Mar 24, 2010 7:48 AM by Steve L Walker

    determining field sequence for barcoded form

    Raja King Level 1

      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

        • 1. Re: determining field sequence for barcoded form
          Steve L Walker Level 5

          Yes. Use a custom script to encode the barcode.

           

          Steve

          • 2. Re: determining field sequence for barcoded form
            Raja King Level 1

            Thanks for the tip

             

            Really appreciate if you can show us example or screenhots of the process.

             

             

            Raja

            • 3. Re: determining field sequence for barcoded form
              Steve L Walker Level 5

              Raja,

               

              Here is a simple example of a custom barcode encoding of a PaperFormsBarcode using a pipe-delimiter.

              p.png

              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

              • 4. Re: determining field sequence for barcoded form
                Raja King Level 1

                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

                • 5. Re: determining field sequence for barcoded form
                  Steve L Walker Level 5

                  Yes. The output from a handheld will be exactly the same format as the format encoded in the barcode.