Hi team.
I am using the LINQ to generate a chart in the word document.
Here is the template and the json data
aspose_question.zip (27.0 KB)
.
I am trying to use removeif feature to not display the 0 value rows, but it gave me the error message:
Please advise if you have any solution for this.
Thank you,
Yiyang
@YiyangShi We will investigate the issue and get back to you soon.
@YiyangShi
As per Including Chart Series Dynamically, the purpose of removeif
tags is removal of a whole series depending on a condition.
However, the provided template contains just a single series, which would yield an empty chart if removeif
triggers. It seems like this is not an expected result and filtering of collection items to exclude zeros is expected instead. If this is the case then <<foreach [in assestAllocation]>>
should be changed to <<foreach [in assestAllocation.where(a => a.geoGFundPer != 0)]>>
instead of using removeif
.
For more information, see Enumeration Extension Methods.
1 Like
Thank you for your solution. it works for me now. Btw do we have any sorting feature in our LINQ report engine? we want to sort the array according to the value.
@YiyangShi
Sure, this can be done by applying orderBy
or orderByDescending
to a collection. See Enumeration Extension Methods for more information.