Expand my Community achievements bar.

Import tab delimited data in livecycle designed form

Avatar

Level 2

Hello,

Is it possible to import tab delimited data in livecycle designed xdp form?

Also will it work when we user right enable form so that user can import their data in PDf form?

Thanks

Manoj

7 Replies

Avatar

Level 2

Hi Paul,

Thanks for taking time to reply my post.

So I was using xfa.datasets.data.loadXML(xmlData,0,1);it loads the form values correctly if I have defined xmlData as string type variable, but I wanted to load data from external xml file into the form how can I do that.

I tried using blank in first param or the file path but nothing works.

Is there another function to do that?

Does Adobe Acrobat pro created form can import tab delimited data?

Thanks

Manoj

Avatar

Former Community Member

That command is used to load a string from a field (usually from a returned web service). If you want to load XML from a file you will wan:

xfa.host.importData("", false);

The 1st param is the path to the file and the second param indicates that you want an XML file (XDP is the default).

Note that I do not think you can load the file unattended without certifying the form. Hence I used a null string. I dialog will pop up and allow you to pick the file.

Paul

Avatar

Level 2

Hi Paul,

I tried using importData with no param, blank param but nothing happens. No dialog box opens.

I am using Live Cycle designer 8.1. hope that does not make a difference.

My debugger console window is also not coming up so can't figure out what is the error. Can you also tell me how to enable javascript debugger

Thanks

Manoj

Avatar

Former Community Member

The debugger will only come up if you are using Acrobat (there is an option to enable the Javascript console - in Acrobat select Edit/Preferences/Javascript and make sure the enable interactive console is checked). If you use the command:

xfa.host.importData()

That should bring up a file chooser dialog.

Paul

Avatar

Level 2

Hi Paul,

This is what I get when in use the function importData

NotAllowedError: Security settings prevent access to this property or method.
Doc.importXFAData:-1:XFA:topmostSubform[0]:Receipt[0]:Button8[0]:click

so what settings are needed and how should my file be formatted. doe sthis function work for XMl or text files or both?

Now when I use load xml function I get this error

Xml parsing error: syntax error (error code 2), line 1, column 1 of file

the file contents are:

<?xml version="1.0" encoding="ISO-8859-1"?>
      <Receipt>
           <cfien>This is the new string</cfien>
      </Receipt>

where receipt is my form name and cfien is my field name.

Can you tell me how to make an XMl file to load the data or give a sample file. Do I need to have SOM expressions in field names?

Thanks

Manoj

Avatar

Former Community Member

The issue is not the command ...it is Reader Extensions. If you used Acrobat you woudl not have an issue. Because you are using Reader you must Reader Extend the document to allow for import and export of data. This can only be done using the LiveCycle Reader Extensions server.

Paul