We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

LinqReportEngine with JsonDataSource using List<string> not working correctly

Hi everyone,

I tried out the JsonDataSource for the LinqReportEngine in Aspose.Words. I wanted to display a List of strings as a comma separated text.

In my example I have following json-data:
“Name”:“Max Mustermann”,
“Ratings”:[“First Rating”],

As you can see there are two arrays of strings: Ratings and Tags. In my Word-Template I used following code to display the arrays:
<<foreach [tag in Tags]>><<[tag.IndexOf()!=0 ? “, “ : “”]>><<[ Tags_Text]>>,<</foreach>>
<<foreach [rating in Ratings]>><<[ rating.IndexOf()!=0 ? “, “ : “”]>><<[ Ratings_Text]>>,<</foreach>>

For both lists the same using, but on generate the Report it works only for the Tags-Array. Adding a second item to the Ratings-Array, it also works for this. In case of an array containing only one item, the LinqReportEngine throws folling exception:
’An error has been encountered at the end of expression ’ Ratings_Text]>’. Can not get the value of member ‘Ratings_Text’ on type ‘System.Char’.'

I also added following line in the Word-template:
<< [Ratings] >>
For the single item array the report engine produces the output “First Rating”, but it only works, if the array contains a single item.

Do you have an idea how I can solve this problem? The example is attached.

Thanks and best regards

I used Aspose.Words for .net in Version 19.9.0.

Example.zip (124.3 KB)


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19332. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-19332) have been fixed in this Aspose.Words for .NET 20.1 update and this Aspose.Words for Java 20.1 update.