Display an image BLOB in a report of the APEX

Hello

I have a BLOB column in a table that contains an image I want to display in a report.

The table definition for the table (MAG_IMAGES) that I store the BLOB in is:

CREATE TABLE 'MAG_IMAGES '.

(NUMBER OF 'MAG_IMAGE_ID',

VARCHAR2 (200) "NUMERO_IMAGENOM_IMAGE."

BLOB "CONTENT."

'MIME_TYPE' VARCHAR2 (1000).

NUMBER OF "DOC_SIZE."

'CONTENT_TYPE' VARCHAR2 (1000).

VARCHAR2 (20) "DISPLAY_AREA."

TIMESTAMP 'LAST_UPDATE_DATE' (6).

ENABLE 'MAG_IMAGES_PK' CONSTRAINT PRIMARY KEY ('MAG_IMAGE_ID')

)

/

It's the Vendor_Group Table where I store the Image_Id.

CREATE TABLE 'VENDOR_GROUP '.

(NUMBER OF 'VENDOR_GROUP_ID',

VARCHAR2 (100) "VENDOR_GROUP_NAME."

"IMAGE_ID" NUMBER

ENABLE 'VENDOR_GROUP_PK' CONSTRAINT PRIMARY KEY ('VENDOR_GROUP_ID')

)

/

I created the following procedure IMAGE_DISPLAY, which I have from a previous discussion forum.

create or replace PROCEDURE image_display (p_image_id number)

AS

l_mime VARCHAR2 (255);

l_length NUMBER;

l_file_name VARCHAR2 (2000);

l_content BLOB;

BEGIN

SELECT content, Mime_type DBMS_LOB.getlength (content)

IN l_mime, l_content, l_length

OF mag_images

WHERE mag_image_id = p_image_id;

    

OWA_UTIL.mime_header (NVL (l_mime, "application/octet"), FALSE);

HTP.p ("Content-length: ' |") l_length);

OWA_UTIL.http_header_close;

WPG_DOCLOAD.download_file (l_content);

EXCEPTION

WHEN OTHERS RAISE.

END image_display;

I then create a region of APEX report with the following source:

Select a.group_product_list,

' < img src = "image_display? p_image_id =' | NVL(a.image_id,0) | "" height ="" | 100. "" / > "photo

vendor_group a, mag_images b

where image_id = b.mag_image_id (+)

and mag_vendor_id = 2;

The Image does not appear, but it looks like this below. I put the column attribute 'Standard report Column '.

BLOB_Report.png

Can someone please tell me what I'm doing wrong?


Thanking you in advance


Dominic

Dominic Dovale wrote:

Hello

I tried to recreate the region from scratch, even in another page altogether but still no luck.

If I run the report without defining the column in a BLOB with its attributes (MIMETYPE column, Table etc.), he does not fail, but returned the following, which is of course the length of the BLOB. The problem only occurs if I set the attributes. Any other suggestions?

Include MAG_IMAGE_ID as a hidden column in the report.

Tags: Database

Similar Questions

  • Display an image blob in a report and form

    Hi all

    Can someone help me. I have a deadline after two days and I want to remedy as soon as possible.

    I use the Application Express 4.1.1.00.23.
    My problem is in the display of an image extracted from a table. In my table, I created these fields to download the image:
    'IMAGE' BLOB,
    "MIME TYPE" VARCHAR2 (255),
    VARCHAR2 (400) "FILENAME."
    DATE OF THE "IMAGE_LAST_UPDATE."

    They have been downloaded successfully. Then, I created a report to select all the attributes of the table. The BLOB attribute displayed as (type of data not supported).
    and when I connect this report to shape, the image appears as a link (< img src = "apex_util.get_blob_file? 50435; s = a = 293574445128601 & p = 29 & d = 65102984724474793498 >")

    I'll be very grateful if someone tell me how to display the image in the table and the form.

    Thanks in advance,
    Sara

    >

    Please update your forum profile with a real handle instead of '941348 '.

    Hi all

    Can someone help me. I have a deadline after two days and I want to remedy as soon as possible.

    I use the Application Express 4.1.1.00.23.
    My problem is in the display of an image extracted from a table. In my table, I created these fields to download the image:
    'IMAGE' BLOB,
    "MIME TYPE" VARCHAR2 (255),
    VARCHAR2 (400) "FILENAME."
    DATE OF THE "IMAGE_LAST_UPDATE."

    They have been downloaded successfully. Then, I created a report to select all the attributes of the table. The BLOB attribute displayed as (type of data not supported).
    and when this report forms a link to a image is displayed as a link (< img src = "apex_util.get_blob_file? 50435; s = a = 293574445128601 & p = 29 & d = 65102984724474793498 >")

    I'll be very grateful if someone tell me how to display the image in the table and the form.

    See doc.41/e21674/advnc_blob.htm">+About BLOB support in forms and reports.

    There is a tutorial OBE which followed the introduction of the declarative BLOB support in 3.1 as well. (An earlier version, but it is still relevant for APEX 4.x.)

    (Please make an effort to check out the documentation and search carefully on the forum for the previous coverage of a topic.) "This is a much discussed question.)

  • How to display an image blob at the top of the RTF model.

    Hello

    I want to display an image blob (company logo) in my RTF model

    My problem is how can I display this image in the header of the template.

    I tried this

    <?

    < fo:instream - foreign-object content-type = "image/jpeg" >

    < xsl: value-of select=".//LOGO"/ >

    < / fo:instream - foreign-object >

    ? >

    but failed

    Thanks in advance.

    I tried this

    <>

    ?>

    but failed

    course

    What is red elements?

    model you can be like

    ... of data...

    (after all data)

    (as a field)

    (in the header/footer)

    a few comments https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

  • UTF8 National characters in the reports of the APEX

    Hello

    We have a table of type NVARCHAR2 column (200), which contains characters russion (utf8).

    It is stored and displayed correctly in our development tools.

    However, in the reports of the APEX (Classic and IR), the values are truncated. It's the same thing when you make a SELECTION in the SQL workshop.

    Once the setting (SELECT * FROM NLS_DATABASE_PARAMETERS):

    PARAMETER VALUE
    NLS_NCHAR_CHARACTERSETAL16UTF16
    NLS_LANGUAGEAMERICAN
    NLS_TERRITORYAMERICA
    NLS_CURRENCY$
    NLS_ISO_CURRENCYAMERICA
    NLS_NUMERIC_CHARACTERS.,
    NLS_CHARACTERSETWE8ISO8859P1
    NLS_CALENDARGREGORIAN
    NLS_DATE_FORMATDD-MON-RR
    NLS_DATE_LANGUAGE

    AMERICAN

    APEX Application is created by default, no globalization setting is changed.

    Any ideas?

    Best regards

    Martin

    APEX and UTF-8 FAQ autour?

  • How do the query select outer join to a report of the APEX

    Hi all

    I'm Ann.

    I have a select statement that is used to calculate statistics for a month (October 2012 in this example)
    Select ph.phase_number
    sum ((case
    WHEN ph.date_finished IS NULL or ph.date_finished > last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
    THEN last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
    Of OTHER ph.date_finished
    END)
    (-ph.date_started + 1) / count (def.def_id) as avg_days
    Ph phase_membership
    inner join court_engagement this on ph.mpm_eng_id = ce.engagement_id
    join in-house defendant def on ce.defendant_id = def.def_id
    where def.active = 1
    and ph.date_started < = last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
    and ph.active = 1
    and UPPER (ce.court_name) LIKE '% '.
    Rollup Group (phase_number)
    ;

    The result is as below
    Phase_Number AVG_DAYS
    Phase One 8.6666666666666667
    Phase two 14.6
    Phase three 12
    11.4615365

    I have another list of selection mainly the list of months between two date value.
    Select to_char (which_month, 'LUN YYYY') as display_month
    de)
    Select add_months (to_date (' ' August 2012 ', ' MY YYYY' "), rownum-1) which_month
    of object
    where
    rownum < = months_between (to_date (' ' Oct 2012 ', ' MY YYYY' "), add_months (to_date (' ' August 2012", "MY YYYY"), - 1))
    order of which_month)

    The query result is as below

    DISPLAY_MONTH

    AUGUST 2012
    SEP 2012
    OCT 2012

    Is it possible I can join these two select statement above to generate a comparable result:

    Days of month Phase number Avg
    August 2012 Phase One 8.666
    Sep 2012 Phase One 7.66
    Oct 2012 Phase One 5,66
    August 2012 Phase two 8.666
    Sep 2012 Phase two 7.66
    Oct 2012 Phase two 5,66
    August 2012 Phase three 8.666
    Sep 2012 Phase three 7.66
    Oct 2012 Phase three 5,66

    Or
    Days of month Phase number Avg
    August 2012 Phase One 8.666
    August 2012 Phase two 7.66
    August 2012 Phase three 5,66
    Sep 2012 Phase One 8.666
    Sep 2012 Phase two 7.66
    Sep 2012 Phase three 5,66
    Oct 2012 Phase One 8.666
    Oct 2012 Phase two 7.66
    Oct 2012 Phase three 5,66

    And it can be controlled by Phase number or month.
    My other colleague suggested I should use a left outer join, but after having tried many ways, I'm still stuck.

    I tried select is
    Select a.display_month, b.* in)
    Select to_char (which_month, 'LUN YYYY') as display_month
    de)
    Select add_months (to_date (' ' August 2012 ', ' MY YYYY' "), rownum-1) which_month
    of object
    where
    rownum < = months_between (to_date (' ' Oct 2012 ', ' MY YYYY' "), add_months (to_date (' ' August 2012", "MY YYYY"), - 1))
    order which_month)) a left outer join

    (Select to_char (ph.date_finished, 'MY YYYY') as join_month, ph.phase_number)
    sum ((case
    WHEN ph.date_finished IS NULL or ph.date_finished > last_day (TO_DATE (a.display_month, 'MY YYYY'))
    THEN last_day (TO_DATE (a.display_month, 'MY YYYY'))
    Of OTHER ph.date_finished
    END)
    (-ph.date_started + 1) / count (def.def_id) as avg_days
    Ph phase_membership
    inner join court_engagement this on ph.mpm_eng_id = ce.engagement_id
    join in-house defendant def on ce.defendant_id = def.def_id
    where def.active = 1
    and ph.date_started < = last_day (TO_DATE (a.display_month, 'MY YYYY'))
    and ph.active = 1
    and UPPER (ce.court_name) LIKE '% '.
    To_char (ph.date_finished, 'MY YYYY'), group (phase_number) rollup) b
    On a.display_month = b.join_month

    but then I get an error
    SQL error: ORA-00904: "A." "" DISPLAY_MONTH ": invalid identifier

    I need to view a report on the APEX with option for people to download at least format CSV.
    Already 1 inteactive report in the page, so I don't think adds another interactive report without using the iframe trick.

    If any of you have any ideas, please help.

    Thank you very much.

    Ann

    Hello Ann,.

    Frank has done a very good job. I am also impressed.

    Is in regard to your correction to his question, the problem is on this replacement you did

    last_day(TO_DATE(am.which_month,'MON YYYY'))
    

    AM.which_month is already a date type, and you don't need to convert it to this day.
    Here is the correct way:

    last_day(am.which_month)
    

    There are also sometimes with the data you've posted have no line for this month. So I also added a function NVL to display 0 under avg_days for these cases.

    Here is my corrected query:

    DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Oct 2012";
    WITH  all_months  AS
    (
       SELECT ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM-1) AS which_month
       ,      ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM  ) AS next_month
       from all_objects
       where
       rownum <= months_between(to_date('&endmonth','MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
    )
    SELECT TO_CHAR (am.which_month, 'Mon YYYY')  AS month
         , ph.phase_number
         , NVL(sum ( (CASE
                     WHEN ph.date_finished IS NULL OR ph.date_finished > last_day(am.which_month)
                     THEN last_day(am.which_month)
                     ELSE ph.date_finished
                  END
                 ) - ph.date_started + 1
               ) / count(def.def_id), 0) as avg_days
      FROM all_months am
           LEFT OUTER JOIN  a_phase_membership  ph  PARTITION BY (ph.phase_number)
              ON  am.which_month <= ph.date_started
              AND am.next_month  >  ph.date_started
              AND ph.date_started <= last_day(am.which_month)  -- May not be needed
              AND ph.active = 1
           LEFT OUTER JOIN  a_engagement  ce
              ON  ph.mpm_eng_id = ce.engagement_id
              AND ce.court_name IS NOT NULL  -- or something involving LIKE
           LEFT OUTER join  a_defendant     def
              ON  ce.defendant_id = def.def_id
              AND def.active = 1
     GROUP BY ROLLUP(phase_number, am.which_month)
     ORDER BY  am.which_month
            ,  ph.phase_number
    ;
    
    The output is:
    MONTH    PHASE_NUMBER           AVG_DAYS
    -------- -------------------- ----------
    Aug 2012 PHASE ONE                     0
    Aug 2012 PHASE THREE                   0
    Aug 2012 PHASE TWO                     0
    Sep 2012 PHASE ONE                    12
    Sep 2012 PHASE THREE                   1
    Sep 2012 PHASE TWO                     9
    Oct 2012 PHASE ONE                     8
    Oct 2012 PHASE THREE                   0
    Oct 2012 PHASE TWO                    14
             PHASE ONE                    11
             PHASE THREE                   1
             PHASE TWO                  11.5
                                  9.71428571
    

    I don't know if that's really what you want. In the case check it and let me know.

    Kind regards.
    Al

  • The number of characters in the CLOB column is supported by the report of the APEX

    Hello

    Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.

    up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    Thank you and best regards,

    Ashish

    2902196 wrote:

    Please update your forum profile with a recognizable username instead of "2902196": Video tutorial how to change username available

    Always include the information referred to in these guidelines when you post a question: How to get the answers from the forum

    Actually, I have a report of the Apex based on CLOB column, which includes data whose length exceeds 10,000 characters.

    up to 10,000 characters, it works fine, but once it get records with characters more than 10 + lift

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    The maximum size of a column report CLOB value is 32 KB. However, the maximum size for the content of the line of the full report is also 32 KB (including the HTML markup), so you can be hitting this limit because of the size of your 10 K CLOB data + the rest of the line.

    According to the database character set and the characters which that contains data, the character encoding may use more than one byte to represent a character.

  • Display an image BLOB in a browser

    OK, I have a table that stores the JPEGs as BLOB Oracle. What I want to do is to read one of these BLOB and display it on a web page. Seems simple.

    The problem is that I can not all first convert the BLOB to a file with UTL_FILE. The image will not be considered as the whole of the content of the page either, it must be in line with any other text content. Our system has a back end of PL/SQL that generates all the HTML code. The Oracle 10 g, pl/sql database is 10.2.0.4.0. The only other technology that can be used is javascript on the client side.

    Is it still possible? I have been stood up by this problem for some time and would appreciate any help I can get.

    Thank you

    Our system has a back end of PL/SQL that generates all the HTML code.

    East - the APEX or based HTMLDB? If so, you can use a procedure such as

    CREATE OR REPLACE procedure download_my_file(p_file in number) as
        v_mime  varchar2(255);
        v_length  number;
        v_file_name varchar2(2000);
        Lob_loc  BLOB;
    BEGIN
        select mime_type, blob_content, name,dbms_lob.getlength(blob_content)
            into v_mime,lob_loc,v_file_name,v_length
            from file_subjects
            where id = p_file;
                  --
                  -- set up HTTP header
                  --
                        -- use an NVL around the mime type and
                        -- if it is a null set it to application/octect
                        -- application/octect may launch a download window from windows
                        owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    
                    -- set the size so the browser knows how much to download
                    htp.p('Content-length: ' || v_length);
                    -- the filename will be used by the browser if the users does a save as
                    htp.p('Content-Disposition: attachment; filename="' || v_file_name || '"');
            -- close the headers
                    owa_util.http_header_close;
            -- download the BLOB
            wpg_docload.download_file( Lob_loc );
    end download_my_file;
    
  • How to display a GIF beside a column value in a report of the APEX?

    Hi all

    I've created a report and I have a numeric column on it.
    I would like to show some image (gif from a location as the Image prefix/app /), but I only need to show the image if the value of this column is "> x'»

    For example, take a look at:

    http://www.troostwijkauctions.com/UK/lots/11959/1868/1/Cranes_and_accessoires.aspx?c=agenda & sort = IDB

    * LotNo 577 for example has a little picture of flames beside him, due to the fact that the number of bids was higher than 5.

    Someone there already does this and can help me with a Board?
    I guess I need to do this in JS placed on the formatting of column in the expression of HTML.

    Thank you
    Ana-Maria

    Ana-Maria

    Use a CASE statement in your SQL as follows:

    SELECT THE CHECK BOX
    WHEN number_bids > 5 THEN
    To_char (number_bids) | » Hot'
    ON THE OTHER
    To_char (number_bids)
    END
    Offers

    Kind regards

    Jon

  • interactive report in the apex of link in pdf format

    I'm building an interactive report based on a view of my oracle table. I want to use the single line view icon to view pdf reports that already exists on my web server. For example, if my line id is xxx, name the pdf file would be xxx.pdf.


    How can I steer to the pdf based on the interactive report right?

    Also how can I restrict the security of the pdf file for those who sail through the apex?

    Thank you

    I won't get into the politics of the opportunity to leave the files in the o/s level, or store them in a table. The pros & cons range from the use of Oracle, generation of size redolog tablespace, backup & duration of restoration on the one hand, to the lack of RI and potential security problems of the file server on the other.

    If your file is stored in a table or an o/s, you can get it in a blob and then use WPG_DOCLOAD.download_file to view it.

    http://Apex.Oracle.com/pls/OTN/f?p=31517:64
    Re: Open a file from the file server: security problem

    By displaying the image via a call to pl/sql, you can easily check that the user is logged on and the right to consult the file before posting to protect themselves against the bookmarking, URL hacking or whatever.

    -ONE

  • String after ' &lt; ' character is not in the reports of the Apex

    Hello

    I've created a report where a column has ' < ' and ' > ' symbol included in this one.
    example of
    1. abc < def girou
    2 abc < def girou
    3 abc > def girou

    If assumes that the data for the column "xyz" in table 1 has 3 data into it above.

    In a report, I show this column with a simple select statement "xyz select from table1.
    the output like this

    1. abc
    2 abc < def girou
    3 abc > def girou


    The report ignores the string after ' < ' and works fine if I have space.

    Can someone help me with this please

    Published by: user12589255 on July 27, 2010 14:39

    Published by: user12589255 on July 27, 2010 15:21

    Hi user12589255,

    I think he just change report column display in the "Standard report column" type to "escaped...". "to overcome this problem.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Report on the APEX users and workspaces...

    How are stored the apex users... is there a table that I can access...
    I would like to create a report in my OBIEE that displays what users exist in what workspaces apex (apex security)...

    Hello

    Users of the workspace are stored in table.
    If you are on version 3.2, something like

    SELECT user_id,
      user_name,
      first_name,
      last_name,
      security_group_id,
      apex_util.find_workspace (security_group_id) AS workspace
    FROM apex_030200.wwv_flow_fnd_user
    

    Of course, you must have privilege to query this table

    Check also check WWV_FLOW_USERS

    BR, Jari

  • Report of the apex - line break

    Hello

    I have a table with the information from the log.

    In the region of report I did a simple sql query as

    Select logdata.l_id, logdata.text

    of logdata

    where logdata.l_id =: P1_ID;

    Now, I have all the information for my client, but for now the apex report looks like this, for example for 3 entries:

    L_ID TEXT
    1

    ABCDEFG hijklmn opqrs tuvwxyz

    2Test1 test2 test3
    3blah blah blah blah blah blah blablablablablablablablablablablablablablablablablabla

    How is it possible to break the line after a special length, while I will you have such a report?

    L_ID
    TEXT
    1ABCDEFG hijklmn opqrs tuvwxyz
    2Test1 test2 test3
    3

    blah blah blah blah blah blah blablablablablab

    ablablablablablablablablablablablabla

    Any ideas? What I have to put in place? A short example would be useful.

    I use apex 3.2 on a company server.

    DB2000 wrote:

    Hello

    I have a table with the information from the log.

    In the region of report I did a simple sql query as

    Select logdata.l_id, logdata.text

    of logdata

    where logdata.l_id =: P1_ID;

    Now, I have all the information for my client, but for now the apex report looks like this, for example for 3 entries:

    L_ID TEXT
    1

    ABCDEFG hijklmn opqrs tuvwxyz

    2 Test1 test2 test3
    3 blah blah blah blah blah blah blablablablablablablablablablablablablablablablablabla

    How is it possible to break the line after a special length, while I will you have such a report?

    L_ID

    TEXT 1 ABCDEFG hijklmn opqrs tuvwxyz 2 Test1 test2 test3 3

    blah blah blah blah blah blah blablablablablab

    ablablablablablablablablablablablabla

    Any ideas? What I have to put in place? A short example would be useful.

    I use apex 3.2 on a company server.

    To begin, what is the real nature of the data 'blablablablablablablablablablablablablablablablablabla '? Why it does not contain white spaces that would allow him to break naturally? (Questions of this nature involving the space without text continue to flow upward. No one ever gives a satisfactory explanation how these data, and why it contains no spaces.)

    I have an old example for a standard report, but it should be easier in modern browsers. Add the following style sheet to the HTML header in report page properties:

    
    

    where the TEXT is to wrap column alias. Change the width setting as needed.

  • Call Javascript in the header of the report of the Apex

    Hello
    I have a javascript function in my html page header I would like to call from my report using a link. I tried to configure the URL of the link column in the report attributes box: javascript:send_sub_email('sharon'). It does not work. My other problem is to know how to pass the value of column of the report to the javascript function. Does anyone know how to do this? All the suggestions and help is greatly appreciated.

    Sharon

    Sharon,

    You should have your JS function in the header section of the HTML Page...

    Lets say your a column named 'EMP_ID' report and now in your report, change the link column and the target set in the updated URL section form URL and after

    javascript:send_sub_email('#EMP_ID#');
    

    So when the user has clicked on the link, it'll pass respective EMP_ID to JS function

    See you soon,.
    Hari

  • Is there a limitation of the list of selection display the number of lines in the report in the apex?

    In my report, I'll run the application process, it is not display 34 rows in the data, but shows only 3 rows that too hardcode rownum < = 20

    the query run perfect in backend

    FOR rec IN (select distinct class_name, id r

    from table_name

    where country_id = (select distinct domicile_country_id of ()

    Select domicile_country_id from table_name table where id = l_ser and domicile__id is not null

    Union

    Select domicile_country_id from table_name table where id = l_ser and domicile__id is not null)) and rownum < = 20 order by 1

    )

    Help, please

    Thanks to all the problem showed lines but the symbol '&' in one line appeared the problem so

    used REGEXP_REPLACE (column_name, ' [and] +', 'and' ') and its done

  • Display a personal message for a report when the number of records returned.

    Our application has a page that displays the results of several SQL statements which are defined as reports. A report should in particular only to display a custom message when the County of invoices with status individual > 0 and not the exact time charged count himself. I got the layout to not display the meter, but I have to be able to display a personalized message that says ' problem invoices exist.» See report of bills, for more information please". I looked on the report attributes definition page but I can't find how to show this custom message. Any tips?

    Simply create a text on the page element. Make read only and put your message in the default value.
    Now put a condition on this point, to display only when required.

    Gus

Maybe you are looking for