Jump to content
We've recently updated our Privacy Statement, available here ×
  • Using lambda expressions for parameter expressions in JasperServer Studio


    Sarthak Chaudhary
    • Features: Parameters Version: v8.2.0 Product: Jaspersoft® Studio

    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>


    User Feedback

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...