Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

No icon for mime type Excel (getIconForMimeType)

We have a Fiori app which can display attachments. Therefore we use the function

  1. sap.ui.core.IconPool.getIconForMimeType(sMimeType);

This works for all of our used file types except MS Excel. For the mime type "application/vnd.ms-excel" we just get a standard icon as you can see on the attached picture. I would expect an E like the W for MS Word.

Is this normal? Is there something I can do? Should I report this?

Former Member
Former Member replied

This isn't the solution itself but it inspires me to find the right work around.

This is my original code:

formatAttachmentIcon: function(sMimeType) {

     return sap.ui.core.IconPool.getIconForMimeType(sMimeType);

},

And these are the mime types belonging to the above attached screenshot:

"MimeType": "image/bmp",

"MimeType": "application/msword",

"MimeType": "application/msword",

"MimeType": "image/gif",

"MimeType": "image/jpeg",

"MimeType": "application/pdf",

"MimeType": "image/png",

"MimeType": "application/vnd.ms-powerpoint",

"MimeType": "application/vnd.ms-powerpoint",

"MimeType": "text/plain",

"MimeType": "application/vnd.ms-excel",

"MimeType": "application/vnd.ms-excel",

This works as you can see for all types besides Excel. The method "getIconForMimeType()" delivers "sap-icon://document" for the input value "application/vnd.ms-excel". This is false.

With you hint I've changed my code in the following way.

formatAttachmentIcon: function(sMimeType) {

     if ( sMimeType == "application/vnd.ms-excel") {

          return "sap-icon://excel-attachment";

     } else {

          return sap.ui.core.IconPool.getIconForMimeType(sMimeType);

     }

},

Now I get the right icon for Excel files. Not the way I like it but it works. Thank you.

BTW In my opinion this is a bug but I have no idea how I can report such issues.

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question