5 Replies Latest reply: Mar 14, 2011 3:34 AM by fac586 RSS

    BLOBS in interactive reports

    scott.wesley
      Hi

      I have a blob defined in a table, along with mimetype and filename.

      If I use
      dbms_lob.getlength(my_blob)

      with the relevant format mask
      IMAGE:MY_TABLE:MY_BLOB:ID::MIMETYPE:FILENAME:::inline:

      I see the image successfully in the interactive report.

      However I can't see any available settings to adjust the width/height of the image. The only examples I see out there are to apex_util.get_blob_file_src - but this requires an item placeholder, which isn't relevant in my report.

      I would also like to utilise the Apex4.0 detail view, also displaying the image within <img> tags, but I can't find any relevant documentation or examples to do this.

      Can anyone assist?

      ScottWe
        • 1. Re: BLOBS in interactive reports
          scott.wesley
          As usual I find solution for the first part after I post - this sort of method worked for me:
          Image column in an interactive report (APEX 4.0)

          I tried it before, just didn't have the syntax quite right.

          I used the procedure that utilised owa_util, and within my report used
          ,'<img src="SAGE.CUSTOM_IMAGE_DISPLAY?p_id='||id||'"/>' test

          Now I'll see if I can use similar concepts for the detail view.
          • 2. Re: BLOBS in interactive reports
            scott.wesley
            Yes, the same theory worked for the detail view of an interactive report

            <img src="SAGE.CUSTOM_IMAGE_DISPLAY?p_id=#ID#" />
            • 3. Re: BLOBS in interactive reports
              Sakthi
              Hi Scott,

              I followed the same steps given in the below link for BLOBS in interactive reports.

              http://apex.oracle.com/pls/apex/f?p=267:11

              Also i uploaded a image in that application.

              Kindly check the following image in that Interactive Report.


              IFRAME - 148
              FILE NAME - IMAGE1


              Am not able to view that particular image. If i click on the IFRAME value to view the details, it saying that Image Archived.

              Can you please help me how to display that archived image too in Interactive Report.

              Thanks in Advance,
              Sakthi.

              Edited by: Sakthi on Mar 11, 2011 12:29 AM

              Edited by: Sakthi on Mar 11, 2011 12:30 AM
              • 4. Re: BLOBS in interactive reports
                scott.wesley
                Sorry Sakthi, I can't see the problem with your example.

                Obviously the other images are displaying properly - I'm not sure what would cause the "image archived" problem.

                Scott
                • 5. Re: BLOBS in interactive reports
                  fac586
                  However I can't see any available settings to adjust the width/height of the image. The only examples I see out there are to apex_util.get_blob_file_src - but this requires an item placeholder, which isn't relevant in my report.
                  Are you looking to set the dimensions on an image-by-image basis or display them all at a fixed width/height? If the latter then it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
                  .apexir_WORKSHEET_DATA td[headers="PHOTO"] img {
                    display: block;
                    width: 40px;
                    border: 1px solid #999;
                    padding: 4px;
                    background: #f6f6f6;
                  }
                  where the <tt>PHOTO</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)

                  However, scaling images in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.