cancel
Showing results for 
Search instead for 
Did you mean: 

Printing and Page Breaks

Former Member
0 Kudos

Hi Experts,

I have an application in which i want to print out the data using adobe interactive forms. I have to create the dynamic non interactive form for every emloyee data and print it. I would like to create a page break and start with that format all over again every time a new employee data starts. Any suggestion how i should go about it using webdynpro for java.

Regards

Abdullah

Accepted Solutions (0)

Answers (2)

Answers (2)

mona_mehta
Participant
0 Kudos

Hi Abdullah,

Have you tried the following solution.

Create your form, as it has to be for 1 employee.

Now create a XML data, and create a dataconnection. Create XML for 1 employee, and then repeat the entire structure for each employee, under the root node.

You'll have to create the data binding, and then specify your file in form properties defaults tab.

when the data is merged...you'll see the subform will repeat for each employee.

If you need an example, send me your mail id.

Thanks

Mona

Former Member
0 Kudos

Hi Mona,

I will really appreciate if you send me the example. I wanted to know how the pdf can be created using XML.

My email address is abdullah.chougle@gmail.com

Regards

Abdullah

mona_mehta
Participant
0 Kudos

Hi Abdullah..

Are you developing a WD application, or will develop the PDF in designer outside NWDS?

Accordingly i'll send you the file and instructions

Thanks

Mona

Former Member
0 Kudos

Hi Mona,

It would be really appreciable, if you could post the file in the wiki area or provide a public link for the same, so that it will be usefull for all forum users.

Thanks and Regards,

- anto.

Former Member
0 Kudos

Hi Mona,

I am trying to develop a WD application.

Regards,

Abdullah Ismail

Former Member
0 Kudos

Hi Mona,

Can you please send me the steps.

Regards

Abdullah

Former Member
0 Kudos

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); 
}

mona_mehta
Participant
0 Kudos

Hi Abdullah,

You can try conditional breaks on the pagination tab of the subform, which you need to break at a condition.

You can make a hidden field, which you can populate with the employee no.

In the edit conditional break of the form.

Click the '+' sign to write the condition to check if the value of the text field has changed, so Break can be set as 'After', and specify the 'To' as Top of Next Content area.

eg. i had a numeric field..'NumericField1'.

I set the condition as

NumericField1.rawValue == 1.

When i set the value of this field as '1' and pressed enter, a new page was created.

Please see if this helps..

Thanks and Regards,

Mona