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
Designing Analytics Reports
Table binding with java
Migrateduser
<p>I open an existing report and add a table that should show allready present dataset.</p>
<p> </p>
<p>I created new table and set it to dataset "Data".</p>
<p> </p>
<div>
<pre class="_prettyXprint">
TableHandle table = designFactory.newTableItem( "table", 6 );
table.setWidth( "100%" );
table.setDataSet( designHandle.findDataSet( "Data" ) ); </pre>
<div>
<pre class="_prettyXprint">
ArrayList cols = new ArrayList();
cols.add("device");
cols.add("duration");
cols.add("lastseen");
cols.add("sample"); //these are the same names that are in the dataset</pre>
</div>
<div>
<pre class="_prettyXprint">
RowHandle tableheader = (RowHandle) table.getHeader( ).get( 0 );
for( int i=0; i < cols.size(); i++ )
{
LabelHandle label1 = designFactory.newLabel( (String)cols.get(i) );
label1.setText((String)cols.get(i));
CellHandle cell = (CellHandle) tableheader.getCells( ).get( i );
cell.getContent( ).add( label1 );
}
// table detail
RowHandle tabledetail = (RowHandle) table.getDetail( ).get( 0 );
for( int i=0; i < cols.size(); i++ )
{
CellHandle cell = (CellHandle) tabledetail.getCells( ).get( i );
DataItemHandle data = designFactory.newDataItem( "data_"+(String)cols.get(i) );
data.setResultSetColumn( (String)cols.get(i));
cell.setName((String)cols.get(i));
cell.getContent( ).add( data );
}
designHandle.getBody( ).add( table );</pre>
</div>
<p> </p>
</div>
<p> </p>
<p>The problem is that when inspecting xml and binding in property editor dataset is selected, but I do not have any Data Column Binding. If I select None and then again to my dataset I get the bindings.</p>
<p> </p>
<p>How to fix this in java, please give code example, I tried a buny of setProperty and setBinding to no avail.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Thanks </p>
Find more posts tagged with
Comments
There are no comments yet