iReport使用不同标签的同一报告的多个副本 [英] iReport multiple copies of same report with different label

查看:164
本文介绍了iReport使用不同标签的同一报告的多个副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 iReport 4.1.3 。我已经创建了发票报告,我希望有3份相同的发票报告。第一张发票的标签应为ORIGINAL,第二张发票应为DUPLICATE,第三张发票的标签应为TRIPLICATE。

I am using iReport 4.1.3. I have created invoice report and I want to have 3 copies of same invoice report. The first invoice should have label as "ORIGINAL", second should have "DUPLICATE" and the third should have label as "TRIPLICATE" on it.

谢谢。

推荐答案

如果你想全部显示每次打开报告时都有三份副本,这里有一个创意,如果不是优雅的解决方案。

If you would like to show all three copies every time you open the report, here is a creative if not elegant solution.

在查询的FROM子句中添加一个交叉连接,返回三个不同的副本。在MySQL中它看起来像这样:

Add a cross join to the FROM clause of your query returning the three different copies. In MySQL it looks like this:

CROSS JOIN
(
Select 'ORIGINAL' as copy, 1 as sequence
UNION
SELECT 'DUPLICATE' as copy, 2 as sequence
UNION
SELECT 'TRIPLICATE' as copy, 3 as sequence
) x

然后将copy字段添加到select语句中。这将导致您的查询为之前返回的每条记录返回3条记录。复制字段中带有ORIGINAL的一条记录,一条带有DUPLICATE,另一条带有TRIPLICATE。将序列添加到ORDER BY子句中。

Then add the "copy" field to your select statement. This will cause your query to return 3 records for each record it was previously returning. One record with "ORIGINAL" in the copy field, one with "DUPLICATE" and one with "TRIPLICATE". Add "sequence" to your ORDER BY clause.

然后在报告中,按复制字段分组。强制为每个组强制新页面,您应该全部设置。您在报告级别总计的任何变量都需要更改为组级别(复制组)。如果摘要部分中有任何控件,请将它们移动到新的组页脚部分。还要创建一个文本字段,以在页面或组标题中显示复制字段。

Then in the report, group by the "copy" field. Force a new page for each group and you should be all set. Any variables you are totaling at the report level you will need to change to the group level ("copy" group). And if you have any controls in the Summary section, move them to the new group footer section. Also create a text field to display the "copy" field in the page or group header.

它不一定很漂亮,但它应该有效。

It's not necessarily pretty, but it should work.

这篇关于iReport使用不同标签的同一报告的多个副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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