Expand my Community achievements bar.

How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

Avatar

Level 2

How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.

I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.

Unable to retrieve the data in multiple rows within webservice method.

11 Replies

Avatar

Former Community Member

You woudl have to define an input parameter for each field ....but there is a variable number of rows so this will not work. I woudl define a single string input parameter and pass the entire XML data that is in the form. You can create a hidden field to hold the data and bind the paraneter to that field. To get the data into the field use this command:

FieldName.rawValue = xfa.dataset.data.saveXML("pretty")

Then when you get the data into the web service you can parse or load the xml into a DOM and get what you want.

Hope that helps

Paul

Avatar

Level 2

I have found the solution to display the multiple rows using table and bind the table rows,columns with array object using wsdl data connection.

Avatar

Former Community Member

Hello,

I have seen Paul used the DOM technique but curious on your solution too.

Can you please share solution with using table to display multiple rows data on a PDF form.

Thanks,

Han Dao

Avatar

Level 2

Hi,

-Insert a table in PDF Form.

-Create a method in WebService returning a Java Array Of Object and

create a Data Connection.

Using DataConnection you can bind the row of Table with Java Array of

Object (return type of web service method). i.e Employee Class Having

two properties "name" and "age". Store the object of class Employee in

Employee[] array. Bind the Array Employee[] with row of Table. Bind

the columns of row with properties "name" and "age".

Bye

Chhavindra Gautam

Avatar

Level 3

Hi Paul,

I don not know if you can help me!

I have a hidden text field that holds an XML returned from database with multiple rows; I want to bind the retrieved data with a table inside the pdf, I read your post but I did not know how to use DOM, can you give me an example.

Thanks

Hussam

Avatar

Former Community Member

You woudl need to load the data into the Dom and assuming the bindings are correct the data will fill the fields. To load the data int the dom you woudl use the command xfa.dataset.data.loadXML(fieldname that holds the data.rawValue). The key is to do find an event that will fire after the web service has completed.

Paul

Avatar

Level 3

Hi Paul,

thank you for your prompt reply. can you please tell me how to bind the DOM to my table?

Thanks

Hussam

Avatar

Former Community Member

The easiest way is to write the data file created to a file on the file system then use that as a data connection in designer and simply drag and drop the nodes in the xml onto the fields in the data stream. Note that you would only do the 1st row of the table.....then you would bind the repeating row subform to the repeating node in the xml.

Paul

Avatar

Level 3

Hi Paul,

I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!

this is my code

TextField1.rawValue=xmlData.document.rawValue;
xfa.datasets.data.loadXML(TextField1.rawValue, true, false);

for(var i=0; i<count; i++)
{

xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
Table1.Row1.instanceManager.addInstance(true);
}

Thanks

Hussam

Avatar

Former Community Member

You shoudl not be putting the values into the table yourself ...this is handled by the binding. If you send me the form and the xml (you can put it into the recieving field and I can load it here) I will set the binding so you can see what needs to be done. You can send it to LiveCycle8@gmail.com .....please include a description of the issue in the email.

Paul

Avatar

Level 2

Hi,

Can you please tell me how you have achived this?

Regards,

Tushar.