简体   繁体   English

Java Jasper Reports,在一行中隐藏特定列,但在该特定行中显示其余信息

[英]Java Jasper Reports, Hiding particular column in a row but displaying rest of the information in that particular row

I am using iReport 1.2.7 tool to create jasper reports. 我正在使用iReport 1.2.7工具创建碧玉报告。
I want to display ' Schedule Date ', ' Engineer Name ' and ' Project ID ' on my report after fetching the details from the database. 从数据库中获取详细信息后,我想在报告中显示“ 计划日期 ”,“ 工程师名称 ”和“ 项目ID ”。 But I want the Scheduled date to be printed only once for one particular Engineer . 但我希望只为一位特定的工程师计划的日期打印一次 Similarly, if an Engineer was involved in multiple projects, its Name should only be printed once, but there should be multiple entries under Project_Id column. 同样,如果工程师参与多个项目,则其名称仅应打印一次, 但在Project_Id下应有多个条目 Below Diagram will make the scenario clear : 下面的图将使情况变得清晰: 在此处输入图片说明

Here, at entry number #1 and #3, Date is only printed once corresponding to that particular engineer and then Engineer Name is printed only once with multiple project IDs . 在此,在条目号1和#3处,仅与该特定工程师相对应的日期仅打印一次,然后,带有多个项目ID的工程师名称仅被打印一次 I tried creating a variable which will store the last engineer name or the date field so that we may check if the current name is similar to the last. 我尝试创建一个变量,该变量将存储工程师的姓氏或日期字段,以便我们可以检查当前名称是否与姓氏相似。 But can't find a way to point to the last fetched row from database. 但是找不到指向数据库中最后获取的行的方法。

Any help or direction in the same is highly appreciated. 对此的任何帮助或指导都将受到高度赞赏。

Try something like this: 尝试这样的事情:

<groupExpression><![CDATA[$F{Scheduled_Date}.toString()+$F{EngineerName}]]></groupExpression>

In the TextFields uncheck "print repeated values" and select your group in "print when group changes". 在“文本字段”中,取消选中“打印重复值”,然后在“组更改时打印”中选择组。

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

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