Hi Team, we are creating report with Linq. We are having chart in the report. For y-axis of the chart, we are passing number still getting error as “An y-value expression must return a numeric value.” Is there any way to convert it to number in template?
Unfortunately, the provided details are not enough to come up with any conclusion. Please share a sample template, data, and code, so we could reproduce and examine the scenario further.
It depends on a particular scenario.
In general, you can use double.Parse
or int.Parse
in expressions as in pure C#. For example, <<[double.Parse(stringValue)]>>
.
However, if using JsonDataSource
, applying of JsonSimpleValueParseMode.Loose
may be a more convenient option as it makes LINQ Reporting Engine automatically convert strings to numbers, if possible. For more information, see Accessing JSON Data.