LINQ Reporting Engine - Getting error while building report "Can not get the value of member 'StarRating' on type 'System.Int32'"

I am getting this error while building report using LINQ reporting engine “Can not get the value of member ‘StarRating’ on type ‘System.Int32’”
I am sending JsonData a {StarRating: 4}.
Please find attached word template that i am using
TestStar.docx (13.6 KB)

@satyam8081

This issue appears because without an object name specified, a property name is resolved for the innermost iteration variable that is integer in the present template. To resolve the issue, you can use a data source name, for example, “ds” and pass it to the engine as follows:

new ReportingEngine().BuildReport(document, dataSource, "ds");

Then, you can use “ds” in a template to explicitly specify which object is intended for looking up for the property. I have modified the template to show this, please check TestStar_Modified.docx (13.7 KB).

For more information on the topic, please refer to Using Contextual Object Member Access.

1 Like

It is working now, Thanks

1 Like