Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Supress duplicate values in tables
Happy_20
Hello
Please find the attached reports.
If you see the report, I want to suppress duplicate values for Node Name, Node Type and Node Total Utilization(report1). I could easily suppress duplicate values for each "Node Name". But if I suppress for Node Type and Node Total Utilization, then it is not repeated for different Node Name(report2). That is, if two different Node Name has same Node Type or same Node Total Utilization, then it is shown only once. I want it to be shown for each Node Name.
Any help would be great.
I am using Birt 2.6
Thanks a lot in advance,
Happy
Find more posts tagged with
Comments
mwilliams
Have you tried using grouping rather than suppress duplicates? If there is just one "Node Total Utilization" value for each Node Name / Node Type combination, you could create a new field that combines NodeName and NodeType into a single field and group on this field, put Node Name, Node Type, and Total Utilization into the group header and the rest of the fields in the detail row. Then, set the "drop" property of the group header cells that contain your data elements to "detail" and you should have what you're wanting. Any time either the Node Name or Node Type changes, then all 3 values would be displayed again, even if they repeated the last value. Hope this helps.
Happy_20
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78763" data-time="1308575260" data-date="20 June 2011 - 06:07 AM"><p>
Have you tried using grouping rather than suppress duplicates? If there is just one "Node Total Utilization" value for each Node Name / Node Type combination, you could create a new field that combines NodeName and NodeType into a single field and group on this field, put Node Name, Node Type, and Total Utilization into the group header and the rest of the fields in the detail row. Then, set the "drop" property of the group header cells that contain your data elements to "detail" and you should have what you're wanting. Any time either the Node Name or Node Type changes, then all 3 values would be displayed again, even if they repeated the last value. Hope this helps.<br /></p></blockquote>
<br />
What is "drop" property of group header ?
mwilliams
It allows for the group value to actually "drop" down to the detail level, so the group row is actually on the same row as the details for the group. To find it, select the cell, not the row that the group data elements are in and go to the general tab of the property editor and you'll see it. Let me know if you have questions.
Happy_20
<blockquote class='ipsBlockquote' data-author="'Happy_20'" data-cid="78796" data-time="1308594155" data-date="20 June 2011 - 11:22 AM"><p>
What is "drop" property of group header ?<br /></p></blockquote>
I got it. Thanks a lot
mwilliams
Not a problem. Let me know if something doesn't work with the solution.
Happy_20
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78805" data-time="1308598193" data-date="20 June 2011 - 12:29 PM"><p>
Not a problem. Let me know if something doesn't work with the solution.
<br /></p></blockquote>
<br />
Now there is a problem for highlighting the background rows.<br />
See the attached Report3<br />
<br />
As compared to report1, I am not able to highlight the detail rows evenly if the Group header row is highlighted.<br />
I have applied event handler for group header row which has the following code :<br />
<br />
import org.eclipse.birt.report.engine.api.script.IReportContext;<br />
import org.eclipse.birt.report.engine.api.script.eventadapter.RowEventAdapter;<br />
import org.eclipse.birt.report.engine.api.script.instance.IRowInstance;<br />
<br />
public class TableCellBackgroundEventHandler extends RowEventAdapter {<br />
<br />
private Integer count=0;<br />
private static String grey = "#D8D8D8";<br />
private static String white = "#FFFFFF";<br />
private static String green ="#CCFF99";<br />
<br />
public void onCreate(IRowInstance rowInstance, IReportContext reportContext) {<br />
count++;<br />
if (count % 2 == 0) {<br />
rowInstance.getStyle().setBackgroundColor(green);<br />
} else {<br />
rowInstance.getStyle().setBackgroundColor(white);<br />
}<br />
}<br />
}<br />
<br />
This only highlights the alternate Group header rows, But at the same time I want alternate corresponding detail row to be highlighted. Can you help me through it?<br />
<br />
Thanks a lot
mwilliams
Hmmm. I hadn't thought about your highlighting with the grouping suggestion. Maybe the best option for you would be to do your own custom suppress duplicates. Remove the grouping, sort on the computed column that you created in my grouping explanation above, create a temp variable in your initialize method, temp = "";. In your visibility expressions, check the current value of the computed field against the "temp" value. If it's not the same, hide the 3 elements, if it's different, show them and update temp to be the current value in the 3rd column only, otherwise it'll be changed before the other columns check it. This should set your highlighting back to correct and suppress your columns as well. Let me know if you get stuck.
Happy_20
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78814" data-time="1308601606" data-date="20 June 2011 - 01:26 PM"><p>
Hmmm. I hadn't thought about your highlighting with the grouping suggestion. Maybe the best option for you would be to do your own custom suppress duplicates. Remove the grouping, sort on the computed column that you created in my grouping explanation above, create a temp variable in your initialize method, temp = "";. In your visibility expressions, check the current value of the computed field against the "temp" value. If it's not the same, hide the 3 elements, if it's different, show them and update temp to be the current value in the 3rd column only, otherwise it'll be changed before the other columns check it. This should set your highlighting back to correct and suppress your columns as well. Let me know if you get stuck.<br /></p></blockquote>
<br />
If you don't mind, Can I get an example
mwilliams
What's your BIRT version?
Happy_20
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78820" data-time="1308604250" data-date="20 June 2011 - 02:10 PM"><p>
What's your BIRT version?<br /></p></blockquote>
Birt Version 2.6
mwilliams
It would be something like this. See the initialize method, and the visibility expressions of the first two column's data elements.
Happy_20
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78852" data-time="1308682723" data-date="21 June 2011 - 11:58 AM"><p>
It would be something like this. See the initialize method, and the visibility expressions of the first two column's data elements.<br /></p></blockquote>
<br />
Thanks it worked<br />
I came across another solution by adding customized BIRT function. It might be helpful to anyone<br />
<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2010/10/birt-duplicate-rows.html'>http://birtworld.blogspot.com/2010/10/birt-duplicate-rows.html</a>
;