on 2022 Mar 11 11:47 AM
Dear Community,
in CAP Fiori Elements List Report we have the requirement to show a line at the buttom that sums up all values of a column (in this example stock) like a total amount. Do you know if this is feasible and if so how would it be implemented?
the first approach was to realize this with the @Aggregation annotation and a presentation Variant as shown below:
schema.cds
@Aggregation.ApplySupported.PropertyRestrictions : true
view Product_View as
select from Product {
key productId,
//@Analytics.Dimension: true
productName,
//@Analytics.Dimension: true
productCategory,
//@Analytics.Dimension: true
productGroupId,
@Analytics.Measure : true
@Aggregation.default : #SUM
stock,
currency_code,
currency
};
annotations:
PresentationVariant #general_tab_Presentation : {
$Type : 'UI.PresentationVariantType',
Text : 'General',
RequestAtLeast : [
productName,productCategory, stock
],
SortOrder : [{
$Type : 'Common.SortOrderType',
Property : productId,
Descending : true
}],
// GroupBy : [
// productCategory
// ],
// TotalBy: [
// productCategory
// ],
// Total : [
// stock
// ],
Visualizations : ['@UI.LineItem#lineItem_general'],
},
As soon as I use the groupBy functionality within my Presentation Variant I receive the following erro:
Has anybody experienced the same error respectively know how a potential solution looks like?
Best Regards
For the "feature is not supported error", please add the following configuration to package.json.
"cds": {
"features": {
"odata_new_parser": true
}
}
I have written the following blog post on this topic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.