Skip to Content
Technical Articles
Author's profile photo Monalisa Biswal

How to get formatting data for columns without displaying them in table


In my current project, we faced issues while applying formatting to table columns in Fiori if the referenced fields are not required in the output list. e.g. If we are using using sematic colors, we need criticality fields to be added to selected columns list. There are also some scenarios where you may just need the column to derive data for another column in the table and you don’t want the column to be visible in the table. e.g. we hide texts in a column based on value of another column

Following link provides details on how to overcome this limitation:

How do I get data for custom columns (icons, formatters etc.) that are not present in the columns

The blog here explains steps for adding a status field in grid table and applying formatting to table column without selecting referenced columns in output.

Steps to add formatting to Grid Table

  • In the CDS view define fields to provide formatting to table column. In this example we will try to change text color and image of text based on status field
  • In table add a column with ObjectStatus UI element with following properties to change color and icon of the text field. Following link provides details on ObjectStatus UI element:
  • After executing the report we can see the colors and icons not displaying in status column of table.

  • After we manually add statusState and statusIcon columns in table, the text color and icon start showing up.

  • In the table declaration add beforeRebindTable method to modify select column list before triggering odata service call

  • Add following in onBeforeRebingTable method to modify selected column list with additional columns needed for table formatting

  • Now if we execute report, we can see formatting applied by default without adding the related columns in the output list:


Though the blog provides a grid table example, the controller logic can be applied to any other table in fiori application. In case of List report, the controller file needs to be extended to add this additional selection logic.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jan Schulz
      Jan Schulz


      cool to see what is possible with the "beforeRebindTable" method.

      For your requirement/issue you should have a look at the properties requestAtLeastFields,ignoredFields,ignoreFromPersonalisation of the sap.ui.comp.SmartTable


      For example:

      <smartTable:SmartTable requestAtLeastFields="NameOrg1,NameOrg2,NameOrg3,NameOrg4">
      	<Table sticky="ColumnHeaders,HeaderToolbar" growing="true" growingScrollToLoad="true" growingThreshold="20">
      			<Column id="Partner" hAlign="Begin">
      					<core:CustomData key="p13nData"
      						value='\{"columnKey": "Partner", "columnIndex":"0", "leadingProperty": "Partner", "sortProperty": "Partner"}'/>
      				<Text text="{i18n>BUSINESSPARTNER}"/>
      			<ColumnListItem type="Active" press=".onPress">
      					<ObjectIdentifier title="{NameOrg1} {NameOrg2} {NameOrg3} {NameOrg4}" text="{Partner}"/>
      		<FlexItemData growFactor="1" baseSize="0%"/>