Reputation: 90
Can we show the total sum value of a particular column at the bottom of the same column in sapui5. Here i'm using sap ui table.
Thanks, Sathish
Upvotes: 2
Views: 13486
Reputation: 21
I got a very nice solution with sap.ui.table.Table
.
Actually adding a footer was not effective because it display the control under the whole table. So What I did is playing with the multiLabels aggregation.
And here I got the Sum displayed under the headline directly.
Upvotes: 2
Reputation: 11
Recently I have come across similar issue, I have through lot of searches and came up with a solution for my scenario.
I have used Last Record as Total for all records and property fixedBottomRowCount="1"
.
Other Possible Solutions:
Upvotes: 1
Reputation: 4225
sap.ui.table.Table
You can use different controls like(grid/layouts) to align as per requirement.
//Create an instance of the table control
var oTable = new sap.ui.table.Table({
title: "Table Example",
//other attributes
footer: new sap.ui.commons.Label({
text:"1234"
})
});
sap.m
libraries:(RECOMMENDED)Adding footer
property will do that. footer is one of the aggregation.
aggregation: footer
cardinality : 0..1
type: sap.ui.core.Control
description: Control to be displayed in the column footer.
Sample code: (use object number instead of Label to differentiate number and currency)
new sap.m.Column({
//hAlign: "Right", use if required
header: new sap.m.Label({
text: "Amount"
}),
footer: new sap.m.ObjectNumber({
number: "{Total}",
unit: "{CurrencyCode}",
state: "Warning"
})
});
Upvotes: 3