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
how to bind a dataset to a dataitem in a grid
Migrateduser
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I use eclipse 4.4.1, windows 8.1, java 7, birt 4.4.1 and the demo-database of birt.</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I have a report in which i add a library.</span></p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">The library has a grid with many dataitems binded to different datasets.</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">How can I add a dataset to a dataitem with java.</span></p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I want to make all with java.</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">My code in the moment is</span></p>
<pre class="_prettyXprint _lang-">
for (Object handleObject : libraryHandleOrder.getComponents()
.getContents()) {
if (handleObject instanceof GridHandle) {
reportDesignHandle.getBody().add(
(DesignElement) ((GridHandle) handleObject)
.copy());
((GridHandle) handleObject).setDataSet(tmpOdaDataSetHandle);
.....
SlotHandle grRows = tmpGridHandle.getRows();
java.util.Iterator rowIterator = grRows.iterator();
while (rowIterator.hasNext()) {
Object rowSlotContents = rowIterator.next();
SlotHandle cellSlot = ((RowHandle) rowSlotContents)
.getCells();
java.util.Iterator cellIterator = cellSlot
.iterator();
while (cellIterator.hasNext()) {
Object cellSlotContents = cellIterator.next();
SlotHandle cellContentSlot = ((CellHandle) cellSlotContents)
.getContent();
java.util.Iterator cellContentIterator = cellContentSlot
.iterator();
while (cellContentIterator.hasNext()) {
Object cellContent = cellContentIterator
.next();
if (cellContent instanceof DataItemHandle) {
((DataItemHandle) cellContent)
.setDataSet(tmpOdaDataSetHandle);
}
}
}
}</pre>
<p>from code above is the following codeimportant, but it don't work at me</p>
<pre class="_prettyXprint _lang-">
if (cellContent instanceof DataItemHandle) {
((DataItemHandle) cellContent).setDataSet(tmpOdaDataSetHandle);
}
</pre>
Find more posts tagged with
Comments
There are no comments yet