cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FioriElements - Grouping of table rows

mHambach
Explorer
0 Kudos
563

Hi FioriElements - experts,
I'm a Fiori Elements newbe and work on my first App. The App displays all kind of information from SAP BP, SAP-FSCD (insurance) and DWH.
Data are coming from CDS-Views. The annotations are done in both, CDS and XML, depending on where it was easier to achieve…

Most things are fairly easy/straight forward and work fine.
However, i'm struggeling with a couple of issue. I found information in the community, but they did not work… 😞 So i decided to bring them up here, hoping to find some advice.
Thanks in advance for any response!
Best regards from Germany
Matthias

Here is the list of all issues. So please check my other posts as well 🙂

ListReport - relatet:
1. Value-Help that does not load the data immediately
ObjectPage - relatet:
2. Dynamic SemanticObject (for SemanticNavigation)
3. Display Labels for a ColumnMicroChart
4. Grouping of table-entries
5. Two tables per section with CollectionFacet-annotationGroup
6. ToolTip for a FieldGroup - Table-Column
---------------------------------

4. Grouping of table-rows

The ObjectPage contains a table, that I want to group.

I tried both, CDS- and XML-annotation:

@ui.presentationVariant: { groupBy: [ 'type' ],
                                            sortOrder: [{ by: 'type', direction: #DESC }, { by: 'name', direction: #ASC } ] }           

<Annotations Target="cds_zcds_bp360_serv.bp_relsType">
…              
<Annotation Term="UI.PresentationVariant" Qualifier="REL_presentationVariant">
    <Record Type="UI.PresentationVariantType">
        <PropertyValue Property="GroupBy">
            <Collection>
                    <PropertyPath>Typ</PropertyPath>
            </Collection>
            </PropertyValue>
        <PropertyValue Property="Visualizations">
            <Collection>
                <AnnotationPath>@UI.LineItem#REL_lineItem</AnnotationPath>
            </Collection>
        </PropertyValue>
    </Record>
</Annotation>
</Annotations>

The CDS-Sorting works, grouping does not work neither way…. 😞

View Entire Topic
Willem_Pardaens
Product and Topic Expert
Product and Topic Expert
0 Kudos

Focusing on the CDS annotations:

- make sure to include a `visualizations` setting in your presentationvariant

- make sure to include the presentationvariant reference in the object page facet where it adds the table to the screen.

mHambach
Explorer
0 Kudos

Hi Willem_Pardaens, thanks for your reply.

I included a visualization setting (a link to the lineItem, which is annotated in the same entity).

However, i don't know, how to add a reference to the presentationvariant in the table-facet.
Never seen coding for this... Could you give me an example...

Willem_Pardaens
Product and Topic Expert
Product and Topic Expert
0 Kudos
here is an example where the Facet is making sure the table is rendered with the PresentationVariant activated: https://github.com/SAP-samples/btp-resource-consumption-monitor/blob/main/cf/app/btprcreport/annotat...
mHambach
Explorer
0 Kudos

Hi Willem, thanks so much for the effort...

So I changed the Facet-Annotation from the LineItem to the PresentationVariant:
<PropertyValue Property="Target" AnnotationPath="to_RELS4BP/@UI.PresentationVariant#RELS_presentationVariant"/>.

Result ist, that the table is not displayd anymore... 😞

I tried to annotate the LineItem and PresentationVariant in CDS and in XML.... Same thing...