Open BLOB Content from an Interactive Report in a New Window

Hi All,
I have an Interactive Report with the following query:
SELECT ID,
  FILE_NAME,
  FILE_MIME_TYPE, 
  FILE_CHARACTER_SET, 
  DBMS_LOB.GETLENGTH(FILE_CONTENT) FILE_CONTENT, 
  FILE_LAST_UPDATED 
FROM FILESThe Number/Date Format property for the FILE_CONTENT column is as follow:
DOWNLOAD:FILES:FILE_CONTENT:ID::FILE_MIME_TYPE:FILE_NAME:FILE_LAST_UPDATE:FILE_CHARACTER_SET:attachment:DownloadWhen I click on the FILE_CONTENT link in the report, depending on the type of file, it opens in a new window or in my report’s window.
I am trying to set the link to always open the content in a new window. I tried changing the Link Attributes to target="_blank" but it did not work.
There is an example in the Package Application “Sample File Upload and Download” on apex.oracle.com. Page 1 has a report that allows you to add files. You can add files such as PDF, SQL, or TXT file in order to replicate my situation.
I appreciate any help!
Thanks,
Erick

The problem is solved!
Apparently the Content Disposition: Attachment in the BLOB Download Format Mask does the trick.
For some reason I have to logout and login again in the application to see the change.
I tried changing the Content Disposition to Inline and then back to Attachment, and the file keeps opening in the same window unless I start a new session.
Is there any explanation why it is working that way?
Thanks!
Erick

Similar Messages

  • How to open a link in an interactive report?

    Hi all,
    we have an interactive report which displays in one column an url.
    If the url is formatted like this 'http://www.test.com', the link can be opened within the interactive report, when it is formatted like 'www.test.com', without the 'http', it can't be openend.
    Is there any possibility that links with 'www.test.com' can be opened as well from the interactive report or do we have to mass update this column on database side?
    Thank you very much!
    BR

    Hi,
    You can modifiy the query of to incorporate http:// to the url name
    select a , b , c , decode(substr( url_filed ,1 , 4), 'http', url_filed, 'http://' || url_filed) from table name

  • Open an on demand sub report in a new window

    Hi There!
    While reading the forum threads, there is an thread that have the same issue that i want to find out, but the thread is not yet answered. Could you guys help me. Thanks!
    Thread by: Kylie Edwards  
    Hi I am wondering if it is possible to open an on demand sub report in a new window.
    I have a report that has 6 level drill and I want to be able to close the information in the sub report to give the end user the ability to keep drilling.
    I have tried inserting a text box with a hyper link back to the main report but hyper links do not seem to work the subreport. "
    Thanks and Regards,
    Joni

    Hi all,
    Sorry for the late reply, and thank you guys for the helped. I manage to solve the problem myself
    To Falk:
    Ya you are right, for what i know,  Inforview is not possible to open a subreport from a RPT file in a new windows as well.
    To Wallie Cheng :
    When i posted the question for help, i just want to know if i could display a crystal report on a new window.
    My situation is that i have a page that is size 3in x 3in ( Just a small static graph ) and i wanna attached a A4 report. In order to have a nicer view at inforview ( 3in x 3in border box ), i will need to reduced the size of the crystal report. The size of the main report is now properly change, but it affects the view for the sub report ( As subreport is A4 size, the system display the A4 size document in a serveral 3in x 3in page. -_-"' ).
    To Abhishek:
    I wanna try out your solution, but i can't find the hyperlink tab in perference option ( in inforview ).
    I manage to solved my problem (suitation that i have explain to Wallie Cheng ). That is to created a hyperlink to the report. Rather than a subreport link.
    Thanks and Regards,
    Joni

  • Downloading blob content from a custom table

    In our hosted Apex application, the following code from the Application Express Developer's Guide works great for allowing a user to download blob content from one of our custom tables via a download button. However, the code doesn't work on the Oracle Cloud because the "owa_util" package is no longer available. The code is as follows:
    CREATE OR REPLACE PROCEDURE download_my_file(p_file in number) AS
    v_mime VARCHAR2(48);
    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="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end download_my_file;
    Besides using web services, does anyone know of a way to do this? Is there a way to add access to the "owa_util" package in the cloud? I have also tried apex_util.get_blob_file_src but that is also unavailable in the Oracle Cloud.
    Thanks,
    Steve

    Following Joel's advice:
    The way I solved this was to split the code between two page processes and one application process. The download button first calls a page process to move the report data into a blob column and then calls another page process which is of "run application process" type. This calls the application level process where the download code, shown below, is called.
    Notice the following changes to the code from the one posted earlier (also from Joel)
    1) added sys.htp.init;
    2) "sys." to all htp, owa and wpg_docload calls
    3) added apex_application.stop_apex_engine; after the wpg_docload statement at the bottom of the script.
    Now the download button launches a "save as" dialog box and the report content is downloaded to the client.
    The code now looks like:
    CREATE OR REPLACE PROCEDURE download_my_file(p_file in number) AS
    v_mime VARCHAR2(48);
    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 oehr_file_subject
    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
    sys.htp.init;
    sys.owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    sys.htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    sys. htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    sys.owa_util.http_header_close;
    -- download the BLOB
    sys.wpg_docload.download_file( Lob_loc );
    apex_application.stop_apex_engine;
    end download_my_file;
    Thanks Joel for your help.
    Steve

  • Link column from an interactive report to insert a row in a tabular form

    Hi, I need your help, i'm new on APEX and i really need to make a "link column" from an "interactive report" to insert a row into a "tabular form".
    I mean that when you click the "link column" instantly create a new row in the Tabular form with the information of the linked row on the interactive report. Its something like that.
    I really appreciate your help.
    Ricardo Capuz

    Hi Ricardo,
    You can use the following code as per your requirement (this is just an example),
    (In this case IR report is in Page#1 and Tabular form is in Page#2),
    On Page#1, Create a hidden item (i.e 'P1_ID')
    IR Report query as like the below,
    select empno,
    ename,
    job,
    mgr,
    hiredate,
    sal,
    comm,
    deptno,
    empno "copy"
    from empUse the below JS code in Page HTML Header section,
    function f_insert_row(pSub)
        $s('P1_ID',pSub);
        doSubmit('ADD');
    Edit  Report Attribute -> copy column -> Under Column Link
    Link Text: Select your column name (i.e. #EMPNO#)
    Target: URL
    URL: javascript:f_insert_row(#EMPNO#);
    Then create a process to insert like below,
    BEGIN
    insert into emp_test (select * from emp where empno=:P1_ID);
    END;Process condition as * Request=Expression1* in Expression1 as 'ADD'.
    At last, create a branch to Page#2, Check 'include process success message' and with the same condition as * Request=Expression1* in Expression1 as 'ADD'.
    Thanks,
    Lakshmi

  • Link column - populating a form from an interactive report?

    Hi
    I have an interactive report which works great. I have now added a link column which leads to a form in my application,
    How can I link the records in the interactive report with the form, so when a user clicks on the link column the form is populated with the details of that record from the interactive report?
    Hope this makes sense

    Hi,
    The easiest way is to create it using wizard when you create a page:
    Create Page -> Form -> Form on a Table with Report
    The link will be created automaticaly on the base of the table Primary key or Rowid.
    Otherwise: On the created Form there should be a page process called similar "Fetch Row from TABLE" (it is automated row fetch process)
    There should be defined the primary key Item.
    Now you can fill this item in report link attribute:
    Link to Page -> your Form
    Set the item Name and Item Value parameters:
    FORM_ITEM_PK #REPORT_ITEM_PK#
    If the Form is based on another table -> just use
    Link to Page -> your Form
    Set the item Name and Item Value parameters(here you can populate more fields - but there will be good to use some dynamic action instead):
    FORM_ITEM_1 #REPORT_ITEM_1#
    FORM_ITEM_2 #REPORT_ITEM_5#
    FORM_ITEM_3 #REPORT_ITEM_3#
    Regards
    J :D
    Edited by: jozef_SVK on 16.7.2012 4:22

  • Converting an image as a blob content from .gif format to .jpg format

    Hi
    Does anyone know how to convert a blob content from .gif format to .jpg format?
    I've tried looking at the process-method of intermedia, but I can't figure out how it's supposed to work... I'm on a 10.2.0.2 standard edition database
    I simply have a blob containing a gif-image, and I want it to be convertet to a jpg-image for further use
    Can anyone help?
    Thank you
    /Klaus Mogensen

    Hi
    Does anyone know how to convert a blob content from
    .gif format to .jpg format?
    I've tried looking at the process-method of
    intermedia, but I can't figure out how it's supposed
    to work... I'm on a 10.2.0.2 standard edition
    database
    I simply have a blob containing a gif-image, and I
    want it to be convertet to a jpg-image for further
    useWhat OS is the database running on? If it is a *nix flavour, you can call out to image magick convert utility (it is pre-installed on most linux variants, and you can compile it from source for other unixes). So you would probably store the blob into a temp file on the database server, call out to the shell to execute convert, and then load a blob from the converted file. See http://imagemagick.org for more information.
    If that is not an option, you might be able to use Java Advanced Imaging API from a Java stored proc to convert between those image formats. See http://java.sun.com/products/java-media/jai/downloads/download-1_1_2.html
    gojko adzic
    http://gojko.net

  • Retrieve SQL with filters applied from an Interactive Report

    I want to use an Interactive report as interface for providing parameters to a base report query.
    I would like to capture the full SQL code from the filtered interactive report and then run the sql to create a collection.
    I have found this tread
    Re: Using Data from filtered Interactive Report
    which says that you can use APEX_APPLICATION_PAGE_IR to access the reports SQL. This holds the information about the interactive report when the user saves it. The sql code from the interactive report (after the user has added filters) is stored in the field sql_query.I can only retrieve the base query and not the filtered version even after saving.
    Any ideas how this can be done would be appreciated.
    regards
    PP

    OK Darren I think I've got it working. My solution is an adaption that follows the steps of a blog I found here: http://stewstools.wordpress.com/2009/02/19/get-ir-where-clause/
    My solution allows you to click on a button and the records that are currently displayed in the IR report are saved to an APEX collection. You can then use the collection to save records to a table or run a report on another page. (I haven't included code for this last step but it's easy to find on the forum)
    First a bit of background knowledge. The following APEX views hold all the information on IRs that you access via PLSQL code in the package you need to download. Run an IR report, save a version of the report, then in SQL Workshop have a look at:
    select * from APEX_APPLICATION_PAGE_IR
    select * from APEX_APPLICATION_PAGE_IR_COND
    select * from APEX_APPLICATION_PAGE_IR_COL
    select * from APEX_APPLICATION_PAGE_IR_RPT
    When you run an IR report it has an internal ID that you can access and also a Base Id for each Saved report that is currently in context.
    Here are the steps:
    1) Download the following package and install it in the workspace schema
    http://www.mediafire.com/?nj118x9vmc9
    click on the link "click here to download"
    2)In the HTML header Attribute of the page where your IR runs, put the following Javascript:
    <!--===================================================================-->
    <!--FUNCTION TO RETRIEVE IR REPORTS SQL WITH WHERE CLAUSE
    <!--===================================================================-->
    <script language="JavaScript" type="text/javascript">
    function SaveAndRunReport() {
    document.location='f?p=&APP_ID.:3:&SESSION.:CONSTRUCT_IR_QUERY:NO::'+
    'P3_BASE_REPORT_ID:'+$v('apexir_REPORT_ID');
    </script>
    <!--===================================================================-->
    Notes: You will need to obviously change the URL above to reflect your Page No. (3) and the name of a HIDDEN Item (P3_BASE_REPORT_ID) that you will populate with the base ID of the report.
    Setting :P3_BASE_REPORT_ID to +$v('apexir_REPORT_ID') is an internal thing and works out of the box. It returns the Id of the Base report.
    3) Create a button called SELECT_SPECIMENS (in region position - top of region) in the IR region that will initiate the execution of the IR background SQL to create a collection with the current selected records.
    TARGET= URL
    URL Target = javascript:SaveAndRunReport();
    You might also want to create a condition that only shows the button when there are records selected
    CONDITION TYPE=Exists(SQL returns at least one row)
    EXPRESSION 1 - put the SQL of the IR report here.
    4)Create a branch back to the same page (3) and with the REQUEST attribute set to the value in the Javascript URL above e.g. CONSTRUCT_IR_QUERY. Create a condition on the branch that uses this branch WHEN BUTTON PRESSED= SELECT_SPECIMENS
    5) Create an AFTER HEADER PROCESS with the following code:
    declare
    v_base_query clob;
    v_where clob;
    v_query clob;
    v_base_where varchar2(12):=' where 1=1 '; -- incase there is no where clause in the base query
    begin
    if apex_collection.collection_exists('IR_COLLECTION') THEN
    htmldb_collection.delete_collection( p_collection_name => 'IR_COLLECTION');
    end if;
    --GET THE BASE QUERY OF THE IR REPORT
    select sql_query
    into v_base_query
    from APEX_APPLICATION_PAGE_IR
    where application_id=:APP_ID
    and page_id=:APP_PAGE_ID; -- you can only have one IR report per page
    --UNCOMMENT TO VIEW THE PARAMETERS TO THE PACKAGED FUNCTION
    --raise_application_error(-20001, :APP_ID||'-'||:APP_PAGE_ID||'-'||:SESSION||'-'||:P3_BASE_REPORT_ID);
    --GET THE SQL FILTER CODE
    select apex_ir_query.ir_query_where(:APP_ID,:APP_PAGE_ID,:SESSION,:P3_BASE_REPORT_ID)
    into v_where
    from dual;
    --CHECK TO SEE THAT THERE IS A "WHERE" CLAUSE IN THE BASE QUERY
    if instr(upper(v_base_query),'WHERE ') > 0 then
    v_query:=v_base_query||' '||v_where;
    else
    v_query:=v_base_query||' '||v_base_where||' '||v_where;
    end if;
    --UNCOMMENT TO SEE THE FULL QUERY SYNTAX
    --raise_application_error(-20001,v_query);
    --CREATE COLLECTION FROM IR RECORDS
    apex_collection.create_collection_from_query(P_collection_name=>'IR_COLLECTION',p_query=>v_query);
    exception
    when others then
    raise_application_error(-20001, 'Interactive report not found. Contact Administrator. Could not create collection of records.');
    end;
    remember to update P3_BASE_REPORT_ID above to your HIDDEN ITEM name.
    Set the following attributes for the process above
    CONDITIONAL PROCESSING
    CONDITION TYPE = Request=Expression 1
    EXPRESSION 1 --> CONSTRUCT_IR_QUERY (Note: this was set on the branch in step 4 above)
    6) Run the IR report, click on the "SELECT SPECIMENS" button then click on the Session link on the Developer's Toolbar and select VIEW COLLECTIONS from the popup list then click GO. You should now see the IR records.
    By the way I've been testing in IE not Firefox.
    ...and that's it!
    enjoy
    Paul P

  • Transferring content from old apple ID to a new one?

    As question says I need help transferring content from old apple ID to a new one as my old apple ID was reported for spam and now I can't use it, thanks!
    [email protected]

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    FAQs   http://support.apple.com/kb/HE37
    However... To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How do i transfer content from my ipod touch to my new PC's iTunes?

    I recently purchased a new laptop. I wanted to know how I can transfer all my content from my ipod touch to my new PC.

    Ideally you would have backed up the library from your old comupter on a regular basis, and have restored that library to your new computer...
    You should be able to:
    Backup the device to the new installation
    Transfer your purchases into a newly authorized library
    Recover any other media using third party tools as suggested in this post
    Restore the device from the backup
    This process should switch the association of the device to the new library, preserving the data and settings in your apps.
    May also be prudent to attempt a backup to iCloud directly from the device before you start... Settings > iCloud > Storage & Backup > iCloud Backup > On. It won't save any media but it would preserve the general account settings and documents in case anything goes wrong while you are trying to extract your other data.
    When you get it all fixed, make a backup!
    tt2

  • Can I transfer content from a 3gs Iphone to a new 5S iphone using bluetooth?

    Can I transfer content from a 3gs Iphone to a new 5S iphone using bluetooth?

    No.
    This has never been a feature of iphone.
    Sorry

  • How can I open a customized report in a new window?

    I am trying to create printable views for my reports that are published as portlets. In specific, I would like a link to open the report up in a new window where the user can print at. I have figured out how to do this with the default report created. However, after a user has customized the report, is there a way to open the customized report in a new window?

    Hi
    I do not think it matters whether your reports portlet is a default one or a customize one. I think whne you place the portlet, you can specify in the property to open up the result in new window. I think it is common feature of Portal.
    Thanks
    Rohit

  • How do i transfer my content from my android phone to my new iphone 5

    How do i transfer my content from my android phone to my new iphone 5 thanks

    sync the old android phone content to google like contacts.  Then sync the new iPhone 5 to google using the carddav protocol.  Google has some great tutorials for seting up the accounts.
    http://support.google.com/mail/bin/answer.py?hl=en&answer=2753077
    Additional way is if its already on the google.com cloud service. Search iPhone App Store for "MobileTrans contacts".
    Or go on iCloud.com then sign up and click on the cogwheel for options. I believe it has import contacts.

  • How can I add the content from a iPod Nano to a new iTunes account

    how can I add the content from a iPod Nano to a new iTunes account

    On the computer in iTunes log into her Apple ID and then see if recent purchases are shown by clicking on her name in iTunes, entering her password and then selecting the option. If there is nothing there then she bought that music with a different Apple ID.
    You can use TouchCopy to move all the songs on the iPod to the computer. Then try to play one of the purchase songs and it should show the account used to purchase it and ask for the password.

  • How do i load content from an existing ipod to a new computer and installation of itunes?

    how do i load content from an existing ipod to a new computer and installation of itunes?

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

Maybe you are looking for