Home
Analytics
Manually add line separator
DmitryB
<div>Hello!</div>
<div> </div>
<div>I have the following structure of the table in my BIRT 2.3.2 report:</div>
<div>
<pre class="_prettyXprint">
| HEADER columns |
|<ID>|<Name>|<Other data>|</pre>
<p>By default our data is sorted by <ID>/<Name>. Using Visibility option of <ID> and <Name> cells, I display these fields only for the first row of <ID>/<Name> pair. E.g., it's displayed as:</p>
</div>
<div>
<pre class="_prettyXprint">
| HEADER columns |
|ID1 Name1 Other data1|
| Other data2|
| Other data3|
|ID2 Name2 Other data4|
| Other data5|
|ID2 Name3 Other data6|</pre>
<p>I need to add line separators between different pairs of <ID>/<Name> (like it's displayed when we have grouped data). For some reason, I can't group by <ID>/<Name> using Table Groups.</p>
</div>
<div> </div>
<div>I've tried the following:</div>
<div>1] Added Top Border for each cell in the row for <ID>, <Name> and etc. and updated OnRender() method to display this line only for the first row of pair <ID>/<Name>, e.g. using JS:</div>
<div>
<pre class="_prettyXprint">
this.getStyle().borderTopStyle = "None";</pre>
<p>It works fine for all columns except Computed columns which the user can add manually when the report is rendered. Each row of Computed column has this line separator and I don't know any way how I can hide it. Do you know any workarounds here?</p>
</div>
<div> </div>
<div>2] I can add a separate row right below our row for <ID>, <Name> and etc. to display this line separator and manually hide this whole separator row if it's not the last record row of <ID>/<Name> pair. But the main problem for me here is to catch the first row of new <ID>/<Name> pair. I.e.</div>
<div>a ) for the current row I need to get if the next row has a new <ID>/<Name> pair or not</div>
<div>OR</div>
<div>b ) for the current row with a new <ID>/<Name> pair I need to update the previous row and make it visible</div>
<div> </div>
<div>Could you please suggest how I can implement any of these two solutions?</div>
<div> </div>
<div>Thanks in advance</div>
Find more posts tagged with
Comments
Clement Wong
<p>It seems that the two workaround solutions can be cumbersome. "For some reason, I can't group by <ID>/<Name> using Table Groups."</p>
<p>Why can't you have two groups ID and Name? Is there an error? What type of data source/set are you using? On your version of BIRT, do table groups work in a different report when you use the example Classic Models database?</p>
<p> </p>
<p>Using the built-in groups would be the ideal solution because you can not need to hide the ID and Name for non-first rows via the Visibliity, and just use the Drop functionality (see this <a data-ipb='nomediaparse' href='
https://enterprisesmartapps.wordpress.com/2011/12/13/birt-drop-group-header-property-and-table-border-lines/'>blog
</a>for an explanation). Also, your ID "group" lines will be displayed according to your requirements.</p>
<p> </p>
<p>"BIRT 2.3.2"</p>
<p>Are you able to use another later version to see if Groups are working there?</p>