java 如何在 iReport 的现有波段之间插入细节波段?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5513385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 11:29:30  来源:igfitidea点击:

How to insert detail band between the existing bands in iReport?

javaireport

提问by Mario

Simple question. How to insert detail band between the existing bands in iReport? For example, I have current situation:

简单的问题。如何在 iReport 的现有波段之间插入细节波段?例如,我目前的情况:



Detail 1

详情 1



Detail 2

细节2



Detail 3

细节3



... and I want to add another detail band between Detail 2 and Detail 3. Is there any simple way?

...我想在细节2和细节3之间添加另一个细节带。有什么简单的方法吗?

Many thanks.

非常感谢。

EDIT: I meant on designer / XML view.

编辑:我的意思是设计器/ XML 视图。

回答by Mario

Ok, I found the solution. I switched into XML view and copied everything between <band>and </band>tags and put into desired position. Sorry for bothering.

好的,我找到了解决方案。我切换到 XML 视图并复制<band></band>标签之间的所有内容并将其放入所需的位置。抱歉打扰了。

回答by Damian Leszczyński - Vash

Multiple details band are available probably since version 3.5.0 of JasperReport.

可能从 JasperReport 3.5.0 版开始就有多个细节带可用。

JasperDesignFactory designFactory = new JasperDesignFactory();
JRBandFactory bandFactory = new JRBandFactory();

JasperDesign design = (JasperDesign)  designFactory.createObject(designAttributes);
JRDesignSection designSection = (JRDesignSection) design.getDetailSection();

JRDesignBand band1 = (JRDesignBand) bandFactory.createObject(bandAttributes);
JRDesignBand band2 = (JRDesignBand) bandFactory.createObject(bandAttributes);
JRDesignBand band3 = (JRDesignBand) bandFactory.createObject(bandAttributes);

designSection.addBand(band1);
designSection.addBand(band2);
designSection.addBand(band3);

More or less that how it goes.

或多或少是这样的。

In XML, you just create another band like default one

在 XML 中,您只需创建另一个像默认带一样的带

In Designer that depend of the designer. For example in iReport (3.7.1):

在设计师中,取决于设计师。例如在 iReport (3.7.1) 中:

Go to "Report Inspector View", right click on default detail band and from context menu you pick "Add Another Detail Band".

转到“Report Inspector View”,右键单击默认详细信息带,然后从上下文菜单中选择“添加另一个详细信息带”。

回答by Vladimir Buskin

You can drag and drop bands in OUTLINE window. So solution in "Design View" will be add new Band and Drag it where you want in OUTLINE window.

您可以在 OUTLINE 窗口中拖放波段。因此,“设计视图”中的解决方案将添加新乐队并将其拖动到大纲窗口中所需的位置。

i am about JasperStudio, may be it was not possible for IReport

我是关于 JasperStudio,可能 IReport 不可能