单击预览时发现iReport编译错误

时间:2015-09-15 09:25:28

标签: jasper-reports

我是iReport的新手并尝试使用iReport生成报告。我得到的问题是没有编译jasper文件。

这是我得到的错误。我怎样才能解决这个问题?我已经设置了字体,无论如何都无法预览报告。

Compiling to file... C:\Users\SDU\Desktop\ugc test\report1.jasper
Errors compiling C:\Users\SDU\Desktop\ugc test\report1.jasper!
Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@1e398a0
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
calculator_report1_1442307421307_832861: 192: expecting ''', found '\n' @ line 192, column 37.
1 error 
    at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:113)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201)
    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354)
    at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:270)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:563)
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:528)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
calculator_report1_1442307421307_832861: 192: expecting ''', found '\n' @ line 192, column 37.
1 error 
    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
    at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131)
    at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359)
    at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:136)
    at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:107)
    at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)
    at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:900)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:564)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:540)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:517)
    at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:109)
    ... 7 more  Compilation running time: 32!

1 个答案:

答案 0 :(得分:0)

也许您在某处使用文本字段而不是静态文本。 文本字段仅接受表达式。 它可能会产生这样的错误。