5 Replies Latest reply: May 5, 2014 6:51 AM by John Dreamflight RSS

    Resizing images from a Blob within classic report

    John Dreamflight

      Hi Guys, i'm looking for some help on resizing images in reports.

      I've followed so many different tutorials & i'm obviously missing something really obvious as i can not get any of the solutions to work for me. the main solution that i'm coming across is adding this into the page html header

       

      <style type="text/css">

      .apexir_WORKSHEET_DATA  td[headers="BLOB_CONTENT"]img

      {

        width: 5px;

      }

      </style>

       

      I've setup an instance on apex.oracle.com & have recreated the same problem i'm having

      i was wondering if anyone could take a look & let me know where i'm going wrong

       

      Workspace: DREAMFLIGHTTEST

      username: help1

      Password: W3lcome1!

       

      its for a project i'm working on with a kids charity i'm volunteering with, usually i'd pay for support & assistance but as this is a volunteer thing i'm on my own with it

        • 1. Re: Resizing images from a Blob within classic report
          Mike Kutz

          You may be better off having the database resize the image for you and storing THAT result in an "image_icon" column.

          The last thing you want to do is transfer a 15MP 10240x9600 image just to have the browser shrink it down to a 120x90 icon.

           

          https://apex.oracle.com/pls/apex/f?p=70399:8:105790931411770:::::

           

          Workspace: MIKEKUTZ_TEST

          username: developer

          Password: trymeout

          Application:  70399 (Basic Stuff)

          Page 8 shows a report

          Page 10 loads an image using a custom Process.

           

          The Process uses the ORDImage data type to resize the image.

          I'm not sure if this will work with XE.

           

          Since you're developing a mobile app:  Upload smartphone image to database

           

          If you still need it shrunken down.. I have another idea.

           

          MK

          • 2. Re: Resizing images from a Blob within classic report
            Tom Petrus

            Unfortunately, ORDImage doesn't work on XE since it is Java.

            • 3. Re: Resizing images from a Blob within classic report
              fac586

              John Dreamflight wrote:

               

              Hi Guys, i'm looking for some help on resizing images in reports.

              I've followed so many different tutorials & i'm obviously missing something really obvious as i can not get any of the solutions to work for me. the main solution that i'm coming across is adding this into the page html header

               

              <style type="text/css">

              .apexir_WORKSHEET_DATA  td[headers="BLOB_CONTENT"]img

              {

                width: 5px;

              }

              </style>

               

              I've setup an instance on apex.oracle.com & have recreated the same problem i'm having

              i was wondering if anyone could take a look & let me know where i'm going wrong

              Several problems with that CSS rule.

               

              Firstly, .apexir_WORKSHEET_DATA is a class selector for use with an APEX interactive report, but you have created a standard report. The equivalent is to use the report template class to apply a style to all reports, or add a static region ID to the standard report region and use that ID to target a single report.

               

              Secondly, td[headers="BLOB_CONTENT"] is an element/attribute selector for table cells with header attributes containing the value "BLOB_CONTENT". This allows a style rule to be applied to all of the cells in a table column. However, the Standard Report in the jQuery Mobile Smartphone theme uses lists and DIVs rather than an HTML table, so there are no table cells or header attributes to be selected.

               

              Thirdly, whitespace characters are used as the combinators in a descendent selector, so there must be a space before the img element selector in the rule.

               

              So basically, other than the img element, nothing in the selector in that rule is relevant to the report you have created.

               

              By adding a std-report static ID to the region, and looking at the report template or inspecting the generated source, we can determine that the rule should be:

               

              #std-report .list-view-cell img {
                width: 50px;
              }
              
              
              

               

              However for performance and image quality reasons you really shouldn't be resizing large images on the fly in the browser (particularly for mobile applications). One way or another, create and serve optimally sized images for different device types.

              • 4. Re: Resizing images from a Blob within classic report
                goodluck247

                It looks like there are 2 discussions on this topic...

                Maybe this would help?

                In my project I use this built-in BLOB function in the report region definition ---> source:

                \

                select pla_id, pla_desc, max_passenger, city_id, '<img src = "'||APEX_UTIL.GET_BLOB_FILE_SRC('P2_PICTURE',PLA_ID)||'" height = "50" width = "60"/>' IMAGE

                from plane

                \

                Good luck

                • 5. Re: Resizing images from a Blob within classic report
                  John Dreamflight

                  Thanks everyone for the pointers.

                  still having trouble with a couple more examples in another app but with the info provided so far I've managed to fix a lot of the reports, the rest I'm sure I can work out from here