Hello everyone,
I have the following requirement:
If i have 12 items in my i_item table:
Page 1 --> 8 items fit
calculate and display subtotal of field amount(WRBTR) of the 8 items at end of page 1
Page 2 --> remaining 4items fit
display the subtotal displayed on the on the previous page as first record of page
display remaining 4 items
calculate and display subtotal of field amount(WRBTR) of these 4 items at end of page 2
In last page calculate and display grand total based on the subtotals
In my table i_item (DATA section) i added a footer section and placed the code SUM(I_ITEM.DATA[].WRBTR[]) in the subtotal field, but it gave the grand total.
As per SDN i changed the code to SUM(WRBTR[]) but nothing is displayed on the form. I also tried SUM(DATA[].WRBTR[*]) and i obtained the valu
Settings used: Formcalc , Client, Calculate, Calculation Script
i also tried the following two Javascript code with the following settings
Javascript, Client, Events with Scripts, Calculation Script
in the footer row and i obtained nothing on screen
first code used:
var fields = xfa.layout.pageContent(0 , "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i) {
if (fields.item(i).name == "WRBTR") {
+total = total + fields.item(i).rawValue;+
}
}
this.rawValue = total;
second code used:
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i)
{
if (fields.item(i).name == "WRBTR")
{
+total = total + fields.item(i).rawValue;+
}
}
this.rawValue = total;
kindly provide help.
thanks®ards;