Evaluate Consulting Services

Displaying the File Type Icon in Oracle APEX Reports


SELECT data.id,

       ‘<span class=”t-Icon file-icon fa ‘

       || Decode(Substr(Upper(data.filename), –4), ‘.PPT’,

          ‘fa-file-powerpoint-o’,

                                                   ‘.XLS’, ‘fa-file-excel-o’,

                                                   ‘.DOC’, ‘fa-file-word-o’,

                                                   ‘.PDF’, ‘fa-file-pdf-o’,

                                                   ‘.GIF’, ‘fa-file-image-o’,

                                                   ‘.PNG’, ‘fa-file-image-o’,

                                                   ‘.JPG’, ‘fa-file-image-o’,

          Decode(Substr(Upper(data.filename), –5), ‘.PPTX’,

          ‘fa-file-powerpoint-o’,

                                                   ‘.XLSX’, ‘fa-file-excel-o’,

                                                   ‘.DOCX’, ‘fa-file-word-o’,

                                                   ‘.TIFF’, ‘fa-file-image-o’,

                                                   ‘fa-file-o’))

       || ‘”></span>’                                              AS icon,

       data.filename,

       data.last_action_on,

       data.last_action_by

FROM   (SELECT epf.id,

               epf.filename,

               epf.file_comments,

               epf.file_blob,

               epf.file_charset,

               epf.file_mimetype,

               lower(Nvl(epf.updated_by, epf.created_by)) last_action_by,

               Nvl(epf.updated_on, epf.created_on) last_action_on

        FROM   ebs_project_files epf

        ORDER  BY created_on DESC) data

WHERE  rownum <= 10; — Print only 10 records for test purpose

Leave a Comment

Your email address will not be published. Required fields are marked *