Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
auto column width?
Migrateduser
<p>[BIRT 4.2.2] - Is it possible to auto detect and set a columns width? Currently I am setting the column width like this:</p>
<pre class="_prettyXprint _lang-">
TableHandle table = designFactory.newTableItem("table", cols.size());
table.setWidth("100%");
table.setDataSet(designHandle.findDataSet("ds"));
PropertyHandle computedSet = table.getColumnBindings();
ComputedColumn cs1 = null;
for (int i = 0; i < cols.size(); i++) {
ColumnHandle columnHandle = (ColumnHandle) table.getColumns().get(i);
columnHandle.getWidth().setValue(width.get(i) + "in");
}
</pre>
<p>The problem is that when I am creating the ArrayList "width" I don't always have a width to set it as. So when I don't have a width I just set it to 200 as a place holder. this is ok as now there are no longer columns with a 0 width. I have a json string that dictates how my report needs to be stylized and one of the atributes that get passed along is autoFitWidth = true or false. I would like to use this to determine wither or not I need to have birt automatically set the column width.</p>
<p> </p>
<p>also something strange about the code above is that changing "in" to "px", "pt", "em", "%", "mm" etc. seems to do nothing. no matter what I change it to the columns are the same width.</p>
Find more posts tagged with
Comments
There are no comments yet