Inner table borders

DenisG
DenisG Member
edited February 11, 2022 in Analytics #1
<p>Hello!</p>
<p>I have a report that has inner table for each outer rows. And when I run it via Birt Report viewer I can see that borders of inner table do not lies on the same line as outer border does (see screenshot). </p>
<p>I merged 5 columns of outer table and inserted a table with 5 columns that has same length that outer col has. There is no padding/marging in cell where my nested table is.</p>
<p>When I ran this report in excel format - everything is fine. </p>

Comments

  • PaulCooper
    PaulCooper Member
    edited February 26, 2016 #2
    <p>What you are trying to do is difficult because the rules for HTML table column widths are complicated. This is made more complicated by the fact that the grid containing the outer table is 240 mm where as the columns add up to 250 mm and you have margins on that table (in points not mm) and the grid cell has padding.</p>
    <p> </p>
    <p>You can tweak the values manually to get them as close to what you want by hand. Instead I suggest you create a single DataSet that combines both DataSet and DataSetGroup and have a single table that uses that.</p>
    <p> </p>
    <p>This will give you a table you need, but the grouping fields that were in the original outer table will get repeated for each inner table row. To get rid of all but first of these in each group you can add a DENSE_RANK() OVER (PARTITION BY <em><grouping_fields></em> ORDER BY <em><sort_fields></em>) analytical function in the SQL to get a rank number and as long as you sort the table correctly then the first row of each group will have a rank number of 1. You can then set the visibility of the grouping fields to hide when the rank is greater than 1.</p>
    <p> </p>
    <p>If you want to merge the grouping field vertically this is possible but requires some clever work with HTML Text field with a div tag with the count of rows in each group as an attribute and some client JavaScript to add rowspans.</p>
  • <p>Thx Paul for your answer! Main reason for my question, which I didn't mention in my original post, was why in the first outer table row borders in inner table are shifted but in second outer row borders of inner table in the right place (exactly under outer table borders).</p>
    <p>It looks like:</p>
    <p>Outer table col borders:               | | | | </p>
    <p>Inner table col borders 1nd row:   | | | |<br>
    Inner table col borders  2nd row: | | | |</p>
    <p>I think that there is some rule why it's shifting differently for even and odd rows.<br><br>
     </p>
  • <p>I have no idea why even and odd rows yield different alignments but I am not that surprised by it. That feature could even be browser dependent. You may be able to fix the positions using CSS but to do that inside a BIRT report that has dynamically generated but limited CSS support would involve lots of complex client-side coding. Also such solutions won't work if you export the report as anything other than HTML (eg. PDF or Excel)</p>
    <p> </p>
    <p>Best to stick to a single table solution.</p>
    <p> </p>
    <p>Paul</p>
  • <p>Paul, could you provide example for vertical grouping with rptdesign file (may be using Classic Models sample database)?</p>
  • <p>Ok here is an example. As I am using Classic Models sample database I couldn't create the Rank values via SQL so I created it via an aggregate binding.