Requirement:
While using lambda expressions while creating parameter expressions in JasperServer Studio we get the following error:
"The target type of this expression must be a functional interface"
Recommendation:
Given the way report expressions are compiled, you need to explicitly cast the expression to the expected functional type. As in:
<parameter name="Parameter1" class="java.util.function.Function">
<defaultValueExpression><![CDATA[(java.util.function.Function<String, String>) ((test) -> {return test + test;})]]></defaultValueExpression>
</parameter>
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now