子报表的相对路径 [英] Relative path for the Subreport

查看:463
本文介绍了子报表的相对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iReport 3.5.0,并在主报告中使用了一个子报告。我不想给出子报表表达式的绝对路径,但是例如,如果我只是给bpSubReport.jasper作为子报表表达式(因为sub和main在同一个目录中),那么iReport可以找到bpSubReport.jasper并将主报告编译到bPReport.jasper中,但是我的Java(gwt)应用程序不能。它抛出异常

I'm working with iReport 3.5.0, and I'm using a subreport inside my main report. I don't want to give the absolute path for the subreport expression, but for example if I just give "bpSubReport.jasper" as the subreport expression (because sub and main are in the same directory), then iReport can find bpSubReport.jasper and compile the main report into bPReport.jasper, but my Java (gwt) application can't. It throws the exception

net.sf.jasperreports.engine.JRException:无法从位置加载对象:bpSubReport.jasper

您可以帮助我了解如何为子报表提供相对路径并让Java应用程序。也找到它?感谢。

Can you help me on how to give a relative path for the subreport and let the Java app. find it as well? Thanks.

推荐答案

好的,我得到了一个答案。

Well I got an answer.

T。您无法为您的子报告使用相对路径。您可能会尝试在运行时编译.jrxml文件,但相对路径似乎无法用于具有外部服务器或文件系统的项目。

You can't. You can't use relative paths for your subreports. You may try to compile the .jrxml files at runtime or something, but relative paths don't seem to work for the projects with external servers or file systems.

这篇关于子报表的相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆