Jump to content
We've recently updated our Privacy Statement, available here ×
  • new java.util.Date().format("MM") method issue while running the report on Jasptsoft studio 8.2.0


    Jivan Phadtare
    • Version: v8.2.0 Product: Jaspersoft® Studio

    Issue :
     

    In latest Jaspersoft studio 8.2.0 when running the report will get below format() method error. 

    The same reports run in older version of Jaspersoft studio (i.e. 6.4.2)


    Error :
     

    Full error log attached with "studio_820_error.txt".

    --------------------------------------------------------------------------------
    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
    1. The method format(String) is undefined for the type Date
                    value = new java.util.Date().format("MM") == "01" ? "09" : //$JR_EXPR_ID=1$
                                                 <---->
    2. The method format(String) is undefined for the type Date
    new java.util.Date().format("MM") == "02" ? "10" : //$JR_EXPR_ID=1$
                         <---->
    .
    .
    18. Syntax error on token "[", { expected
                    value = ["H01 ","H02 ","H03 ","H04 ","H05 ","H11 ","H12 ","H13 ","H20 ","H21 ","H22 ","H23 ","H24 ","H25 ","H26 ","H27 ","H28 ","H31 ","H32 ","H40 ","H43 ","H44 ","H57 ","H59 ","H61 ","H63 ","H65 ","H66 ","H68 ","H69 ","H73 ","H75 ","H76 ","H78 ","H79 ","H81 ","H82 ","H85 ","H87 ","H88 ","H89 ","H90 ","H92 ","H96 ","H99 "]; //$JR_EXPR_ID=7$

                            ^
    --------------------------------------------------------------------------------

     

    Resolution :
     

    This is not a bug in Jaspersoft studio rather there was breaking changes in the Groovy languag 2.5, and as a part of "groovy_3.0.7.jar" these changes introduced in JRL 6.17.0.
    As a apart of beaking changes "format()" method  is no longer available in updated groovy jar version.

    In order to resolve this, need to put the groovy jar "groovy-dateutil-3.0.7.jar" in the studio 8.2.0 installation plugin directory (PFA : "groovy_jar_copy_location.PNG").

    We have tested with this and we could see the collection parameter popullated without format() error message. (PFA : "studio_820_sucess.PNG")

    The attached "groovy-dateutil-3.0.7.jar"  jar file need to put in the plugin studio directory and restart the studio software.


     

    groovy_jar_copy_location.PNG

    groovy-dateutil-3.0.7.jar


    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...