Expand my Community achievements bar.

Using importTextData to load text files

Avatar

Level 2

I have been having a real issue trying to load data from text files (tab delimited text file) into my form.

It works fine if I use importTextData() with no parameters and it prompts for the file name, then the row, but if I try and pass the path and row it comes back with a -2 result "User Cancelled Row Select".

My path is formatted as so: "/C/temp/importfile.txt"

It has to do with the path somehow... otherwise my file would not load properly when browsed.

And before people let me know I can import my information via an XML file, yes I know, but for this task, is not an option.

The end goal is to have a fixed drop-down on the form and depending on which item they select, Acrobat will load a text file into various controls.

I have attached my sample if someone wants to take a look.

Any help people can give is greatly appreciated.

Paul

2 Replies

Avatar

Level 2

My example was not very good. I  replaced it with a new (see attached).

Previously I found my problem to be  the header row in the text file was not formatted properly. ie. rather  than have "task" as the column header it had to be  frmProgressCard[0].frmTasks[0].tblTasks[0].rowTask[0].task[0]

That does  not work any longer.

I save all the work in LiveCycle as Adobe Dynamic XML  Form and then open it in Acrobat Pro to test, but still will not load my  data. Returns with "invalid row" error.

So I think the problem is that first  row that is suppose to link up with the text fields in the form, but I  can't seem to find the proper format.

The help file only says to put in  the field names, ie. "task", but that does not work.

Thanks

Paul

Avatar

Level 2

Just tested this under Acorobat Pro 8 and it worked fine.

What is different in 9 that causes it not to work?