Skip to main content
kandices70514105
Known Participant
August 6, 2019
Question

sorting rows

  • August 6, 2019
  • 1 reply
  • 1063 views

I have a fillable pdf that I created.  It has about 12 columns and about 250 rows.  I need to be able to sort the rows either alphabetically or by client number without unaligning the rows.  Each column has info specifically related to the name on each row.  However I have to add to the end throughout the year.  Can i sort so I do not have to recreate each yeAR?

kANDICE

    This topic has been closed for replies.

    1 reply

    try67
    Community Expert
    Community Expert
    August 7, 2019

    Data in a PDF file can't be sorted, unless it is all located inside of form fields and a ​lot of effort is put into writing a script that can do it.

    kandices70514105
    Known Participant
    August 7, 2019

    The data is in several form fields.  Each column has a certain piece of info, and the each line is a different client.  It is a list I use each year to keep track of certain state returns I have to file.  This list has all the information to file for each client like the taxpayer number, SIC codes, NAICS Codes, etc.  So I need to keep each row in tact but be able to sort by client name.  So sorting rows not columns while keeping each row aligned.  I tried to use scripting to do this but I am doing something wrong.  Of course I don't really know what I am doing with the scripting. I am totally guessing....  I guess I just need a bit of clarification on how to use and apply the scripting.  Any Suggestions??

    try67
    Community Expert
    Community Expert
    August 7, 2019

    Here's how I would do it:

    - Read the data from all the fields to an array of literal objects, or arrays, or something like that.

    - Clear the fields.

    - Sort the array based on the desired criteria (read up on the sort method of the Array object: JavaScript Array Sort )

    - Write the data from the array back to the fields.