Home
Analytics
How to add borders inside the birt table report
birtbeginner
<p>Dear all:</p><p>I am developing a birt tabular report and really want borders inside the detailed rows but don't know how to do it. I tried to add borders for the whole table using properties but the border only applies to outside of the table. If I select border for each cell then there's space between each cell. I did google it but found out the solution Jason suggested is set the properties as follows:</p><p>CellHandle cell = (CellHandle) tableheader.getCells( ).get( 0 );
cell.setProperty(StyleHandle.BORDER_BOTTOM_COLOR_PROP, "#000000");
cell.setProperty(StyleHandle.BORDER_BOTTOM_STYLE_PROP, "solid");
cell.setProperty(StyleHandle.BORDER_BOTTOM_WIDTH_PROP, "2px");</p><p> </p><p>I have no idea where and how to set the properties, can anyone give me some detailed guidances on that?</p><p>Thank you!</p><p>Maggie</p>
Find more posts tagged with
Comments
mwilliams
<p>Are you using the designer? Or Java?</p>
birtbeginner
<blockquote class="ipsBlockquote" data-author="mwilliams" data-cid="128397" data-time="1402001063"><div><p>Are you using the designer? Or Java?</p></div></blockquote><p>Thank you for replying my msg! Michael</p><p>I used designer and actually solved later just by creating a style with border and apply that to my report.</p><p>Now I have new problem coming in that has really blocked me. I tried to expand and collapse the report by a group.</p><p>I used some JAVAscript created by Jason, here's the original code:</p><p> </p><p><form></p><p><script></p><p>function hidetable(form, ord, rwcnt){</p><p> </p><p>//alert( document.getElementById(ord).style.display );</p><p> </p><p> </p><p>var hide = false;</p><p>var btnstr = "mybutton"+ord;</p><p> </p><p>if( document.getElementById(ord).style.display == 'block' || document.getElementById(ord).style.display == ""){</p><p>document.getElementById(ord).style.display = 'none';</p><p>document.getElementById(btnstr).value = "+";</p><p>//form.btnstr.value = "+";</p><p>hide = true;</p><p>}else{</p><p>document.getElementById(ord).style.display = 'block';</p><p>document.getElementById(btnstr).value = "-";</p><p>//form.btnstr.value = "-";</p><p>hide = false;</p><p>}</p><p>for( i=0; i< rwcnt; i++ ){</p><p>var drow = ord+""+i;</p><p>if( document.getElementById(drow)){</p><p>if( hide ){</p><p>document.getElementById(drow).style.display = 'none';</p><p>}else{</p><p>document.getElementById(drow).style.display = 'block';</p><p>}</p><p>}</p><p>}</p><p> </p><p> </p><p> </p><p>}</p><p> </p><p></script></p><p> </p><p><INPUT Type="BUTTON" name=<VALUE-OF>"mybutton"+row["ORDERNUMBER"]</VALUE-OF> Value="-" onClick='hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>, <VALUE-OF>row["Aggregation"]</VALUE-OF> )'></INPUT> <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF></p><p><script></p><p>hidetable( this.form, <VALUE-OF>row["ORDERNUMBER"]</VALUE-OF>, <VALUE-OF>row["Aggregation"]</VALUE-OF> );</p><p></script></p><p> </p><p></form></p><p> </p><p> </p><p>I copied and pasted the code and the only difference I made is to change the script part by switching [OrdrNumber] in the original code to my column name [state_name]. But it didn't work for me.</p><p>I debugged a little and foud out that the hidetable()function never get called. The only difference here is the datatype. [Ordernumber] is an integer and my state_name is a string</p><p>Any idea why? I will open new post for that.</p><p>Thank you!</p><p>Maggie</p>
mwilliams
<p>Sorry for the delay in response. Did you get a solution to your issue?</p>
prpundge
<p>Hi,</p>
<p> </p>
<p>I am using BIRT(4- version)</p>
<p>I Have a list ,</p>
<p> In that list setted the values using Display( inline) in the Detail row of the list</p>
<p>Now I need to place the border of each column </p>
<p>If Column is empty I no need to display the border with cell </p>
<p> </p>
<p>Reply to mail naresh.amarthaluru@gmail.com</p>