on 07-17-2007 7:19 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.