Skip to Content
avatar image
Former Member

Abdullah Ismail pls help. (Creating PDF Dynamically)

Hi Abdullah

I have a similar problem to what you just solved, but I have a few questions relating to your answer below:

In your context , create a node MasterNode of cardinality 1...1 and singleton set to true. Bind this to the dataSource property of the InteractiveFormElement.

Inside this MasterNode create a node Data of cardinality 0...n and singleton set to false. Keep all of your payslip attributes inside this node.

In your interactive form element , in the Body Page create a subform of Type Flow Content and Flow Direction Table .Check the chechbox for Allow Page Breaks within Context . Inside this subform create another subform of Type Flow Content and Flow Direction Western Text . Uncheck the checkbox for Allow Page Breaks within Context . Put all of your pay slip UI elements inside this subform and bind them with the attributes under the node Data. Also tick the property of the inner subform under the section Object->Subform that says Repeat Subform for each Data Item


In your view controller coding area , create an element of the node Data for each employee record and populate it with values for the particular employee .

Add all of the elements that you created into an ArrayList and bind this ArrayList to the node Data. Now your form is ready for n number of employees.

Put this sort of coding in your view controller coding:


IDataElement objData = null; 
ArrayList arlData = null; 
int intNumberOfEmployees=0; 
 
try 
{ 
        arlData = new ArrayList(); 
        intNumberOfEmployees = //Get size of your model node that returns employee info 
        if(intNumberOfEmployees>0) 
        { 
                for(int i=0;i<intNumberOfEmployees;i++) 
                { 
                        objData  = wdContext.createDataElement(); 
                        objData.setName("//Value fetched from backend here");//Eg:wdContext.nodeEmployeeInfo.getEmployeeInfoElementAt(i).getname() 
                        //Similarly set all of the values 
                        arlData.add(objData); 
                } 
        } 
        wdContext.nodeData.bind(arlData); 
}

I am using Abode LC 7.0.

for my Table subform, the Allow Page Breaks within Context checkbox is greyed out. Also pls could you shoe me the structure of your context nodes?

I don't see from your code how a new page is created each time the employee changes?

thanks

Anton Kruse

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 03, 2007 at 11:56 AM

    Hi Anton,

    I think I have got your problem. You have added two subforms under body pages(that makes it a total of three subforms in your application and hence the problem). You need to add only one. If you navigate to the hierarchy view, on the left hand side of Adobe Live Cycle, you will see that there is already one subform. That is your main subform(Subform 1). You need to add one more subform to this(Subform 2). All your context nodes will be added under Subform 2.

    I have mailed you my application. Hope it helps.

    Regards,

    Abdullah

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I managed to fix the problem I was having but is too complicated to post here.

      If anyone is looking for same solution. pls contact me via my business card.

      regards

      Anton