Jasper Report syntax error on compiling

0
  • Jasper report - Netbeans latest plugin for ireport (plugin for 7.4)
  • JDK - 1.8
  • Netbeans 8.2

I am using java 8 streams inside the jrxml file. Stream function working fine outside the jrxml and when I compile the report It gives me below error :

Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@3155ed77
 
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Syntax error on token "-", -- expected
.sorted(java.util.Comparator.comparing(p -> p.getId())) //$JR_EXPR_ID=9$
                                         ^
2. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
          ^
3. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
                                         ^
4. Syntax error on token "-", -- expected
.filter(com.court.handler.FxUtilsHandler.distinctByKey(p -> p.getMemberLoanCode())) //$JR_EXPR_ID=9$
                                                         ^
5. Syntax error on token "-", -- expected
.sorted(java.util.Comparator.comparing(p -> p.getId())) //$JR_EXPR_ID=9$
                                         ^
6. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
          ^
7. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
                                         ^
8. Syntax error on token "-", -- expected
.filter(com.court.handler.FxUtilsHandler.distinctByKey(p -> p.getMemberLoanCode())) //$JR_EXPR_ID=9$
                                                         ^
9. Syntax error on token "-", -- expected
.sorted(java.util.Comparator.comparing(p -> p.getId())) //$JR_EXPR_ID=9$
                                         ^
10. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
          ^
11. Syntax error on token "-", -- expected
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus()) //$JR_EXPR_ID=9$
                                         ^
12. Syntax error on token "-", -- expected
.filter(com.court.handler.FxUtilsHandler.distinctByKey(p -> p.getMemberLoanCode())) //$JR_EXPR_ID=9$
                                                         ^
12 errors
 
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:512)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

Here is my variable expression :

<variableExpression><![CDATA[$F{memberLoans}.stream()
.sorted(java.util.Comparator.comparing(p -> p.getId()))
.filter(p -> !p.isIsComplete()).filter(p -> p.isStatus())
.filter(com.court.handler.FxUtilsHandler.distinctByKey(p -> p.getMemberLoanCode()))
.collect(java.util.stream.Collectors.toList())]]></variableExpression>

I already add my application jar and latest jdt-compiler jar to the classpath and changed the source to 1.8 as well but still It gives me the above mentioned error.

Any suggestion would be really helpful. Thank you.

shanakaperera08's picture
Joined: Apr 13 2014 - 2:36am
Last seen: 2 months 2 weeks ago

1 Answer:

0

iReport does not support JDK8. You'll need to use Jaspersoft Studio or version down to JDK6 or JDK7.

hozawa's picture
56382
Joined: Apr 24 2010 - 4:31pm
Last seen: 7 months 2 weeks ago
Feedback
randomness