Home
Analytics
How to get the row count in a fixed grid
germobirt
Hi,<br />
<br />
using Birt 2.6.2 I wanna use a fixed grid (e.g. 3 cols, 30 rows, may vary for diff reports) <br />
and add labels and set descriptions in the cells and set border colors with java script.<br />
<br />
This way I can access all columns only in the first row.<br />
<br />
var grid = this.reportContext.getDesignHandle().findElement("myGrid");<br />
row = grid.<strong class='bbc'>getRows().get(0);</strong><br />
<br />
cols = this.getReport().getGrid("myGrid").<strong class='bbc'>getColumnCount</strong>()<br />
for (var i = 0; i < cols;i++) {<br />
cell = row.getCells().get(i);<br />
}<br />
<br />
But why is there nothing like '<strong class='bbc'>.getRowCount()</strong>' ?<br />
<br />
I mean, its a matrix with a fixed set of rows and columns, but I see not such a method.<br />
<br />
How can I get the row count?<br />
<br />
regards
Find more posts tagged with
Comments
kclark
If the chart is fixed you could add a variable to your report to store how many rows your grid has. That way you can reference it later.
kclark
You can also get the row count doing something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.getDesignHandle().findElement("myGrid").getRows().getCount()</pre>
germobirt
Hi,
this method is available and working!
... .getRows().getCount();
Why is this not shown in the code completion of my Birt RCP Client?
regards