Aspose Words LINQ Reporting Engine with DataSet

Hi

I’m trying to bind a .Net DataSet to a document using LINQ Reporting Engine.

I’ve tried using a very simple dataset:

<?xml version=“1.0” encoding=“UTF-8”?>
<Document>
<ID>1234</ID>
<Message>Is it working yet?</Message>
</Document>

My code:

DataSet dsx = new DataSet();
dsx.ReadXml(DOCDIR + “Data/simple.xml”);
Document doc = new Document(DOCDIR + “LinqToDataSet.docx”);
ReportingEngine engine = new ReportingEngine();
engine.Options = ReportBuildOptions.AllowMissingMembers;
engine.BuildReport(doc, dsx, “doc”);

My document markup/binding:

<<[doc.Document[0]]>>
<<[doc.Document[0][0]]>>
<<[doc.Document.ID]>>
<<[doc.Document[0].ID]>>

I’m not having any success. Please help?

Thanks

@john.berman

Please use the template syntax as shown below to get the correct output.

<<foreach [item in doc]>><<[item.ID]>>
<</foreach>>

Please call BuildReport method as shown below.

engine.BuildReport(doc, dsx.Tables[0], "doc");

Moreover, we suggest you please read the following article.
Template Syntax