cancel
Showing results for 
Search instead for 
Did you mean: 

No icon for mime type Excel (getIconForMimeType)

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

That is really crazy. There are icons for nearly every mime type besides Excel. Has anybody an idea how I can investigate which mime types are supported generally?

Former Member
0 Kudos

Hi Gil,

I guess you can use "excel-attachment" code to get excel icon displayed for Excel mime type. This is one of the icon provided in SAPUI5 framework.

Please have a look into icons tab in SAPUI5 developer guide or the below link directly.

Icon Explorer  :-  Icon Explorer

Hope this helps you.

regards,

Sabarinathan C

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

0 Kudos

What "application / ??" application is for this image?