The method DAY(Date) is undefined for the type invoice_sub

0

Hi,

I have an JRXML file (not compiled) in my Java classpath.

It worked perfectly, but I had to make some changes in the code, and I started using internal Jasper methods:

DAY(Date)
DAYSINMONTH(Date)
MONTH(Date)

When I am testing it in the Jasper Designer, everything is fine. But in the java app, when I am trying to compile the report and generate the PDF file I get errors:

1. The method DAY(Date) is undefined for the type invoice_sub_1557138584226_714026
                value = String.format("%2s", DAY(((java.util.Date)parameter_ORDER_DATE.getValue()))).replace(" ", "0") + //$JR_EXPR_ID=9$
                                             <->
2. The method MONTH(Date) is undefined for the type invoice_sub_1557138584226_714026
        String.format("%2s", MONTH(((java.util.Date)parameter_ORDER_DATE.getValue()))).replace(" ", "0") + //$JR_EXPR_ID=9$
                             <--->
3. The method DAYSINMONTH(Date) is undefined for the type invoice_sub_1557138584226_714026
        String.format("%2s", DAYSINMONTH(((java.util.Date)parameter_ORDER_DATE.getValue()))).replace(" ", "0") + //$JR_EXPR_ID=9$
                             <--------->

What have I done wrong?

zbigniew.nitecki's picture
Joined: Mar 21 2019 - 2:21am
Last seen: 6 months 1 week ago

1 Answer:

0

Maybe missing jasperreports-functions-xxx.jar in the class path?

https://sourceforge.net/projects/jasperreports/files/jasperreports/Jaspe...

hozawa's picture
52592
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 1 week ago
Feedback