Total Field Bean
Walkthrough
The elements for displaying the two totals are almost identical. You will now replace these elements with a report bean following a similar procedure:
1. Copy and paste the total label and textbox fields into a report bean.
2. Select 'Bean Definition' from the Style Studio Report menu. This opens the 'Bean Definition' dialog box.
3. Add the label and total field 'Text' properties to the bean properties in the 'Bean Definition' dialog box.
4. Replace the total fields with two 'total field' beans.
5. Change the table script to assign the calculation results to the bean
var total1 = 0, total2 = 0;
for(var i = 1; i < table.length; i++) {
var price = table[i]['Total'];
if(price > 1000) {
for(var c = 0; c < table[i].length; c++) {
cellBackground[i][c] = 0xBBFFBB;
}
total1 += price;
}
else {
total2 += price;
}
}
totalOver.value = formatNumber(total1, '$#,###.00');
totalBelow.value = formatNumber(total2, '$#,###.00');
A report bean can include presentation elements, properties, and dynamic behaviors to create a self-contained module.
| << Report Header Bean | © 1996-2013 InetSoft Technology Corporation (v11.5) | 4 Queries >> |