Hi,
We have an xml as shown below. We have to iterate through the xml and insert the data into a table in word.
xml File:
<Results>
<Row>
<value1>xyz</value1>
<value2>xss</value2>
</Row>
<Row>
<value1>dfa</value1>
<value2>xsdfas</value2>
</Row>
<Row>
<value1>asb</value1>
<value2>dse</value2>
</Row>
<Row>
<value1>dfadf</value1>
<value2>fadsf</value2>
</Row>
</Results>
Currently we have given the below code in the word template: (value1 and value 2 are in different columns of a table).
<<foreach [ result in Row]>> | <<[result.value1]>> | <[ result.value2]>> <</foreach>>
The java code for pdf generation is given below,
Document doc = new Document(dataDir + fileName);
ReportingEngine engine = new ReportingEngine();
PdfSaveOptions options = new PdfSaveOptions();
options.getOutlineOptions().setDefaultBookmarksOutlineLevel(1);
options.getOutlineOptions().setDefaultBookmarksOutlineLevel(2);
DataSet ds = new DataSet();
ds.readXml(dataDir+"AcutalData4.xml");
engine.buildReport(doc, ds);
dataDir = dataDir + "AcutalData_otput4.pdf";
doc.save(dataDir);
But After a certain limit it is throwing IndexOutofBound Exception.
Can you please help me on this?