10 Replies Latest reply: Jan 1, 2013 9:25 AM by jariola RSS

    Image in IR report

    Ahmed Alsaied
      Dears,
      i am try to add image in IR report but it's not appear
      this table structure
      CREATE TABLE  "EMPLOYEE" 
         (     "EMP_CODE" VARCHAR2(200) NOT NULL ENABLE, 
           "EMP_NAME" VARCHAR2(200), 
           "COMP_ID" NUMBER, 
           "POSITION_ID" NUMBER NOT NULL ENABLE, 
           "GROUP_ID" NUMBER, 
           "EMP_IMAGE" BLOB, 
           "FILESIZE" VARCHAR2(4000), 
           "MIMETYPE" VARCHAR2(4000), 
           "FILENAME" VARCHAR2(4000), 
            CONSTRAINT "EMPLOYEE_PK" PRIMARY KEY ("EMP_CODE") ENABLE
         )
      /
      ALTER TABLE  "EMPLOYEE" ADD CONSTRAINT "EMPLOYEE_R01" FOREIGN KEY ("COMP_ID")
             REFERENCES  "COMPANY" ("COMP_ID") ENABLE
      /
      ALTER TABLE  "EMPLOYEE" ADD CONSTRAINT "EMPLOYEE_R02" FOREIGN KEY ("POSITION_ID")
             REFERENCES  "POSITION_TYPE" ("POSITION_ID") ENABLE
      /
      ALTER TABLE  "EMPLOYEE" ADD CONSTRAINT "EMPLOYEE_R03" FOREIGN KEY ("GROUP_ID")
             REFERENCES  "GROUP_SETTING" ("GROUP_ID") ENABLE
      /
      
      CREATE UNIQUE INDEX  "SYS_IL0000030135C00006$$" ON  "EMPLOYEE" (
      /
      this the query in the report
      select "ROWID", 
      "EMP_CODE",
      "EMP_NAME",
      "COMP_ID",
      "POSITION_ID",
      "GROUP_ID",
      CASE WHEN NVL(dbms_lob.getlength(EMP_IMAGE),0) = 0
          THEN NULL 
          ELSE CASE WHEN MIMETYPE like 'image%'
          THEN '<img src="'||apex_util.get_blob_file_src('P509_IMAGE',EMP_CODE)||'" class="image" />' 
          ELSE 
          '<a href="'||apex_util.get_blob_file_src('P509_IMAGE',EMP_CODE)||'">Download</a>'
          end 
          END new_img,
      nvl((select sum(dbms_lob.getlength(EMP_CODE)) s from EMPLOYEE where EMP_CODE = p.EMP_CODE),0) as  "EMP_LOGO"
      
      from "#OWNER#"."EMPLOYEE" p
        
      what's the problem ?