简体   繁体   English

IReport-子报表作为Inputstream参数

[英]IReport - Subreport as Inputstream parameter

I have a Subreport, that works well, and I have a another report that is using the Subreport and also works well in the IReport; 我有一个很好的子报表,还有另一个正在使用该子报表的报表,并且在IReport中也运行良好。 always that I use the subreport from "file Path". 总是我使用“文件路径”中的子报表。

But, I want to add the reports in a JAR (OSGI Bundle), and will execute the report using InputStream to load the Jasper Reports. 但是,我想将报告添加到JAR(OSGI捆绑包)中,并将使用InputStream执行报告以加载Jasper报告。

Using IReport Designer(version 5.6.0), The Tool to design the Report, is giving me a "Warning" when I change from "File Path" to "Inputstream" in the SubReport Expression Property. 当我在SubReport Expression属性中从“文件路径”更改为“ Inputstream”时,使用设计报告的工具IReport Designer(版本5.6.0)会给我一个“警告”。

The warning is: 警告是:

Unable to locate the subreport with expression: "$P{SUBREPORT_1}".

What is the best way to run the report using IReport? 使用IReport运行报告的最佳方法是什么?

This warning just means that iReport is trying to compile the subreport, but can't find it. 此警告仅表示iReport正在尝试编译子报表,但找不到它。

When you were using "File Path", you could put the full path to the subreport file, and iReport would find it. 使用“文件路径”时,可以将完整路径放入子报表文件,然后iReport会找到它。

Since you changed to an InputStream, iReport doesn't know how to find the subreport to compile it. 由于您已更改为InputStream,因此iReport不知道如何找到子报表进行编译。

When the report runs inside your application, though, you will feed that information as a parameter and it will run normally. 但是,当报表在您的应用程序中运行时,您会将这些信息作为参数提供,并且它将正常运行。

If you want to stop that warning, just disable the compilation of subreports. 如果要停止该警告,只需禁用子报表的编译即可。 Go to Tools , Options , iReport , Compilation and Execution and untick the option labeled "Compile Subreports (if can be found)". 转到“ Tools ,“ Options ,“ iReport ,“ Compilation and Execution然后取消选中“编译子报表(如果可以找到)”选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM