Read complex XML to Dataset

Hi,


While reading and XML file using the following code:

DataSet dataSet = new DataSet();
dataSet.readXml(new FileInputStream(new File(“pathToFile”)));

when having nested elements, I always have to use .first() to access each element using LINQ report engine.

Is there a way to avoid doing this, especially when I have a deep nested element that I want to access, I don’t want to do <<Element1.first().element2.first().element3.first()>>




Hi there,

Thanks for your inquiry. Could you please attach your XML, input Word document along with expected output here? We will then provide you more information about your query along with code.
Thank you for your reply. Here is a sample code:

DataSet dataSet = new DataSet();
dataSet.readXml(new FileInputStream(new File("test.xml")));
Document doc = new Document("test2.docx");
ReportingEngine engine = new ReportingEngine();
engine.buildReport(doc, dataSet, "doc");
doc.save("out.pdf");

Please find attached the files.
Hi there,

Thanks for sharing the detail. You can use <> in your template document instead of <>.

We suggest you please read following links for your kind reference.

If you still face any issue, please share some more detail about your requirement. We will then provide you more information on this along with code.