Hi,
I am attempting to evaluate Aspose for our purposes and I’m running into an issue with the LINQ Reporting Engine. When I try to run the code below I keep getting an error that the engine cannot find the column name as defined in my DataTable. I have checked a few other posts on this forum and see similar syntax and object usage so I’m not sure what I’m doing wrong here. Please let me know if someone could be of assistance.
Code Snippet:
ReportingEngine engine = new ReportingEngine();
DataTable FieldNamesValues = new DataTable();
FieldNamesValues.Columns.Add("Name");
FieldNamesValues.Columns.Add("Value");
foreach (string sKey in reportFields.Keys)
FieldNamesValues.Rows.Add(sKey, reportFields[sKey]);
engine.BuildReport(doc, FieldNamesValues, "ds");
doc.Save("out.docx");
Word Template:
This is an example
from a Data Set object:
<<[ds.Name.txtHeaderText]>>
Note that the code fails when looking for ds.Name so it’s not finding the column I’ve added to the data table.
Thanks,
Mike