Hi
I have the need to build a word doc, using the ReportingEngine where xml will be inserted in 4 word tables within the document
XML Example
.......The generation of the xml may not always contain of the rows for the 4 tables
My code is a follows:
// build the word template path
var wordTemplate = Path.Combine(_templatePath, WordTemplateXmlRenderResultsDocx);
// load the template
var document =
new Aspose.Words.Document(wordTemplate);
var xmlNodeReader = new XmlNodeReader(_xmlDocument);
var dataSet = new System.Data.DataSet();
dataSet.ReadXml(xmlNodeReader);
// build the report
var engine = new Aspose.Words.Reporting.ReportingEngine();
engine.BuildReport(document, dataSet);
When using something like
<<foreach [a in Results]>>
<<foreach [b in a.Table1]>>
<<foreach [c in b.Rows]>>
…
<><><>
I have no issue
However if I try the following
<<foreach [a in Results]>>
<<foreach [b in a.Table2]>>
<<foreach [c in b.Rows]>>
…
<><><>
When there is no xml the ReportingEngine exception as there will be no table in dataSet
Is there a way to conditional check inside the word doc using the ReportingEngine marked for the table existance
Thanks