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
ScriptedDataSource with JavaObject containing a List into Table/Grid
Migrateduser
<p>What i have:</p>
<p> </p>
<p>i gain rows of <strong>Loan </strong>(Objects). each of it contain relations to <strong>LoanItem</strong>(s).</p>
<p>i do have access to those <strong>LoanItem</strong>(s) via</p>
<pre class="_prettyXprint">
row["loanItems"] // list of Java Objects</pre>
<p>i can also access the fields on (both Loan and LoanItem) it, all fine till here.</p>
<p> </p>
<p>What i try to do:</p>
<p>to define a <strong>Table </strong>or <strong>Grid </strong>with 4 <strong>Columns </strong>and defining the <strong>expressions </strong>how to fill each row with data from my List (of LoanItems), but did not find a way to do so.</p>
<div> </div>
<div>IFF this is possible, how?</div>
<div> </div>
<div>an dirty attempt was generating html and put this into a Text or Dynamic Text Report Item, but this does not look good and it does not really work out at all...</div>
<pre class="_prettyXprint _lang-js">
<value-of>
var items = row["loanItems"].size() + " items";
for (var index = 0; index < row["loanItems"].size(); index++) {
var loanItem = row["loanItems"].get(index);
items += (index==0) ? "\n<br>" : ",\n<br>";
if (loanItem.getObject()!=null){
items += loanItem.getObject().getId();
}
items += " | " + loanItem.getLoanPieces();
if (loanItem.getObject()!=null){
items += " | " + loanItem.getObject().getTaxon().getName();
}
// items += loanItem.getObject().getTaxon().getName();
}
// output items
items;
</value-of>
</pre>
<div>i hope this explanation is not too vague.</div>
<p> </p>
<p>Thanks in advance!</p>
Find more posts tagged with
Comments
There are no comments yet