Expand my Community achievements bar.

Binding cells in a dynamic table and exporting that to csv

Avatar

Former Community Member

I made a dynamic pdf that has a table in it.  The user can add/remove rows to the table. Table starts with a single visble row by default.

The first cell of the row is a drop down list selection, bound as "Drugtype"

The second-fifth cell of the row are numeric fields, all bound as "InvItem"  They get bindings in my hierachy as InvItem[0}, InvItem[1], etc. automatically by Livecycle Designer.

To add more rows, I use a button, (in javascript,)

form1.BodyPage.FormProper.Inventory.MoreInventory::click - (JavaScript, client)

InventoryTable._InventoryEntry.addInstance(1);

To delete a row....

form1.BodyPage.FormProper.Inventory.InventoryTable.InventoryEntry.DeleteRow::click - (JavaScript, client)

_InventoryEntry.removeInstance(this.parent.index);

This works exactly as intended,  except it totally screws up my .csv output

Say for example I enter 3 rows of data....

Row 1, for DrugType I select "morphine" and enter numbers 111,011,001

Row 2, for DrugType I select "fentanyl" and enter numbers 222, 022, 002

Row 3, for DrugType I select "Valium" and enter numbers 333, 033, 003

I use a third party service that accepts html input and emails me a .csv (LuxSci it is called.)

The problem is that my .csv looks like this form that form...(I am displaying this as regular text so it is easier to read and understand.)

 DrugType[0]   = Morphine
* DrugType[1]   = Fentanyl
* DrugType[2]   = Valium
* DrugType[3]   = disabled
* InvItem[0]    = 111
* InvItem[10]   = 333
* InvItem[11]   = 033
* InvItem[12]   = 003
* InvItem[1]    = 011
* InvItem[2]    = 001
* InvItem[3]    =
* InvItem[4]    =
* InvItem[5]    = 222
* InvItem[6]    = 022
* InvItem[7]    = 002
* InvItem[8]    =
* InvItem[9]    =

My question: How can I match up the dynamic rows so that the InvItem numbers for Morphine match up with Morphine?, etc.

How do you bind the individual table cells of a dynamic table to allow this?

I'm totally perplexed and any help would be appreciated.

1 Reply

Avatar

Former Community Member

It looks like the output is being sorted in alphabetical order instead of how they appear in the data file. If you export the data out of the PDF

then you will get your data in the order that you expect. There is not much we can do on this end ....you should talk to the provifer and see if they can give you raw Data instead of sorted data.

paul