on 01-29-2014 1:59 PM
Hi,
I have developed an ADOBE PDF in which I want to show a table in read only format. This table is populated by a web service but when i do this only one row is showing.
What have I done :-
I have made a table in UI and bind it with the response of web service in proper hierarchy means first table then body row and then columns.
I have also checked "repeat row for each data item" in body row and min count is 1.
Please Give me suggestions if I have done any thing wrong.
Thanks,
Amit
hi amit
here is solution for your problem that is dynamic too.
here is my pdf form's hierarchy
here is my pdf form's dataview
here i have binded IvRegNo and IvUserId textfields to IvRegNo and IvUserId request parameter of web service named 'DataConnection' .
And i have binded 'Table2' to 'EtEntShareHolder' response and
'Row1' to 'item[*]' and each textfield from Cell1 to Cell8 to respective fields of item .
ie. Cell1 to Name
Cell2 to Zzafld00047 and so on.
set the min count of Table2 to 1 and ,remaining max and initial should be unchecked.
set the min count of the Row1 to any number ex 5 ;and remaining all should be unchecked
you can either assign default values to IvRegNo and IvUserId textfield or at run time . it depends on you.
you can write this javascript code on regular button for execution of web service or on code initialization
// for executing the web services
xfa.connectionSet.DataConnection.execute(0);
var In = 0;
//find the length of Row1 instances
var len = xfa.resolveNodes("Pages.Table2.Row1[*]").length;
var i=0;
for(i;i<len;i++)
{
if((xfa.resolveNode("Pages.Table2.Row1["+i+"].Cell1").rawValue == null)
&&(xfa.resolveNode("Pages.Table2.Row1["+i+"].Cell2").rawValue == null)
&&(xfa.resolveNode("Pages.Table2.Row1["+i+"].Cell3").rawValue == null))
{
In = 1;
xfa.resolveNode("Pages.Table2.Row1["+i+"]").presence = "hidden";
}
}
var min = 0;
if((In ==0)||(In =="0"))
{
while(1)
{ // ADD 4 DYNAMIC INSTANCES
Pages.Table2.Row1.instanceManager.addInstance();
Pages.Table2.Row1.instanceManager.addInstance();
Pages.Table2.Row1.instanceManager.addInstance();
Pages.Table2.Row1.instanceManager.addInstance();
xfa.connectionSet.DataConnection.execute(0);
var len1 = xfa.resolveNodes("Pages.Table2.Row1[*]").length;
for(i=0;i<len1;i++)
{
if(xfa.resolveNode("Pages.Table2.Row1["+i+"].Cell1").rawValue == null)
{
min = 1;
xfa.resolveNode("Pages.Table2.Row1["+i+"]").presence = "hidden";
}
}
if((min=="1")||(min==1))
{ break;}
}//END OF WHILE
}//END OF IF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
My Web Service is called using a 'Regular' type button and in the click event i have written following code:
var cURL = "WSDL URL"; |
var service = SOAP.connect(cURL);
xfa.connectionSet.DataConnection.execute(0);
WSDL URL replace with your URL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi amit,
this is static solution but it will work , first you set the min count of the row up to max no of records that can be displayed on the pdf forms and write the code after execution of webservice
var len = xfa.resolveNodes("Pages.Table2.Row1[*]").length;
var i=0;
for(i;i<len;i++)
{
if(xfa.resolveNode("Pages.Table2.Row1["+i+"].Cell1").rawValue == null)
{
xfa.resolveNode("Pages.Table2.Row1["+i+"]").presence = "hidden";
}
}
here i m hidding the rows that are null ..
my pdf form's hierarchy is
hope it will work
Regards
Jitendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian and Saud,
Now I am getting the Table by the following way.
By javascript :-
xfa.connectionSet.DataConnection2.execute(1);
or
In the object tab of button of web service another sub tab execute. Inside that there is a checkbox
"Remerge Form Data" when I check it result is coming.
But another problem is started that remerge refreshes the pdf and the data which are coming from Code initialization is gone.
Please Help Me. It's urgent.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you try binding the 'Request of Web Service' as well to the body row and check?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi amit,
see the databinding, if there is * in the end. That is a important thing. Min-Count you checked, be sure, you haven't set perhaps the MAx-Count with 1.
Also be sure, you do that in the design view (If there is no space, there will not show anything
Be sure, the subform has the proper parameters, eg flowed, height is variable and stuff like that.
There are too many options, which can be set perhaps in the wrong way, to help you out with such less informations.
If you waorked through all that and it doesn't work as designed (perhaps it does right at the moment)
share some screens of the options, you made, so somebody got a real chance to give you a answer...
Regards
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.