无法解析为 Jaspersoft Studio 类型

Ala*_*lan 6 jasper-reports

使用 jaspersoft Studio 6.1.1

我想要实现的是将我得到的数字转换为罗马格式,为此我添加了一个我创建的 .jar 来完成这项工作,问题是,当我尝试使用我的函数时.jar,我收到以下错误:

    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. RomanNumeral.roman cannot be resolved to a type
                value = new RomanNumeral.roman(1); //$JR_EXPR_ID=8$
                            <---------------->
2. RomanNumeral.roman cannot be resolved to a type
                value = new RomanNumeral.roman(1); //$JR_EXPR_ID=8$
                            <---------------->
3. RomanNumeral.roman cannot be resolved to a type
                value = new RomanNumeral.roman(1); //$JR_EXPR_ID=8$
                            <---------------->
3 errors
Run Code Online (Sandbox Code Playgroud)

RomanNumeral 是名称是 .jar 和类。

我到处寻找类似的错误,但没有帮助

知道为什么会这样吗?

Ala*_*lan 7

我可以解决我的问题,如果有人有同样的问题,我希望这可以帮助他们。

将 .jar 添加到项目的 java 构建路径后,您必须将其导入到要使用的报告中。

图书馆

将其导入您的报告

然后,要使用 .jar 中的函数,我必须像这样编写函数的路径“package.Class.Method”,在我的例子中是:

com.certuit.utils.RomanNumeral.roman(1)

com.certuit.utils是包。

RomanNumeral

roman(1)是我想使用的方法

这对我有用。