Home
Analytics
Table column squished, how to force width?
akk2
So I have a table with multiple columns, most columns have short values but one has a large one, and this large one keeps getting squished and appears on multiple lines, ex:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Col1 | Col2 | ColLong | col ...
1 | 23 | This text of | 09-05-10
| | long column |
| | appears on |
| | multiple |
| | lines and |
| | there seems |
| | to be no way |
| | to make it |
| | appear wider |
| | so that the |
| | is on one |
| | line |
2 | 233 | This text of | 09-05-11
| | long column |
| | appears on |
...
</pre>
<br />
So I've tried different things and nothing seem to work... Set the width to 5 inch in the table column, put the detail to 'inline', consistently squished on multiple lines... I'm also using report 'auto-layout' so that probably has something to do with it.<br />
<br />
So any way to have a column be automatically larger? <br />
<br />
Thanks!
Find more posts tagged with
Comments
johnw
You only have so much screen real estate to work with. If you want it to automatically expand without line breaking, you will need to remove the explicit width declarations from the columns, the table, and any parent containers to the table. Then, since the top most container is the report body, you will need to set the master page size to something that can accommodate. Either set it to landscape, or set it to a custom width that is large enough, like 20 inches.
akk2
Thanks! Didn't think of it that way! Yeah that seems to work fairly well when viewing the report; it still appears squished by default, but when increasing the browser's width so it can accommodate the table's width, the wider column expands. But, when for example printing/exporting to PDF, or viewing the report without re dimensioning the window, the squish is back, with something like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Col1 | Col2 | ColLong | col |
1 | 23 | This text of | 09-05-10 |
| | large column is | |
| | a bit wider but | |
| | other columns | |
| | grew and ate | |
| | the space | |
</pre> <br />
It's like by default Birt tries to make every column as wide as each other, and if one is 80% empty it'll still enlarge it, and if another column's text is way too wide it won't make it any bigger but will simply spawn the text on multiple lines...<br />
<br />
There must be a way to tell Birt to format its columns in an optimized/logical way depending on data... Ah but yeah I think I already asked this question and was told I'd have code a way to compute the width of each record's width and then manually (through programming) dynamically set the columns width...<br />
<br />
Ok anyway in this case I'll have the possibility to manually enter width in inches, which seems to work well with the larger page, so I'm pretty much all set! ^_^ Thanks for your quick help!