Free Support Forum - aspose.com

How to use dynamic data source in Linq Reporting engine .NET

I had a similar question and found this thread.


This will fail with the exception "Can not get the value of member ‘Name’ on type ‘System.Dynamic.ExpandoObject’."

Template document with the following content:
<<[Name]>>

var doc = new Document(pathToDocTemplate);
dynamic person = new ExpandoObject();
person.Name = “John”;
var engine = new ReportingEngine();
engine.BuildReport(doc, person); //exception thrown here

It would be nice if the reporting engine supports dynamic data source.

Thanks,
Minh

Hi Minh,


Thanks
for your inquiry. I have logged this feature request as WORDSNET-12148 in our issue tracking system. Our development team will look into the
possibility of implementation of this requested feature. Once we have
any information about this feature, we will update you via this thread.

Please let us know if you have any more queries.

Hi Minh,

Further to my last post, we suggest you please use DataSet/DataTable/DataRow objects when dealing with data having dynamic structure. The DataSet class has built-in capabilities to read data from a database or XML file/stream. Also, there are several components enabling to fill a DataSet instance from a JSON string. Moreover, it can be filled manually, if needed.

Note that LINQ Reporting Engine enables to use the same syntax for DataSet/DataTable/DataRow objects (including extension methods) as would be used with regular class instances thus making report templates almost the same in both cases. Please read the following article for more information.
Working with Traditional Mail Merge Data Sources