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

Similar Messages

  • 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

  • Automatically populating a Form from data stored in Access

    Hi,
    I need help automatically populating a form from data stored in Access. The form needs to have specific fields that are updated from an Access database. I want to be able to enter a site number and have the subsequent list of information (approximately 35 pieces of data) populate. I DO NOT want to update the Access database via the form. The form is for quick viewing and documentation only, not data entry. Currently I've been doing this with VB in Access which exported the data to a Word Document which was then saved as a PDF. It seems easier and less troublesome to go directly to the PDF form, but I can't figure out how!
    I have already connected my database to the form using OLEDB.
    I don't want a dropdown list and I don't want buttons to scroll through the sites (I've already found out how to do that through this forum).
    Any help would be very much appreciated!!

    Some more help to get started in this.. would be really appreciated..Are you trying to come up with the graphs yourself? IF so, are you familiar with MVC?

  • Manual Tabular Form Generation in Interactive Reports

    Dear All;
    I used the following statement to generate a tabular form in an interactive report region;
    SELECT
    id No,
    apex_item.text(1,C1,3,4, ,'f01_#ROWNUM#') C1
    from test_table
    The no of items on the form depends on the number of rows in test_table. However, I am unable to reference the individual cells in the form. it turns out apex is using the same id for each row( f01_#ROWNUM#) in the generated source code and is not substituting rownum for the row number (eg. f01_1 for first row, f01_2 for second row generated in a normal report template). Is there something I'm doing wrong or is this a bug? I am running on apex 4.0.1
    Any assistance will be greatly appreviated.
    Benedict.
    Edited by: Zulu on Sep 11, 2010 2:16 PM
    Edited by: Zulu on Sep 11, 2010 2:29 PM

    Hi Trent,
    It is working fine now... " You have saved my life and I am eternally grateful" :-) .
    Br,
    Benedict.
    Edited by: Zulu on Sep 12, 2010 7:44 AM

  • 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

  • Pass value from previous interactive report to create record form

    Hi All,
    I am an APEX newbie and have an APEX 3.2.1 application that is still being developed that is working reasonably well. The problem I am having is the following:
    I have 3 interactive reports. These are defined on their respective tables, namely, clients, servers, and databases. By clicking on a client name, it shows the servers that are associated with that client. By then clicking on a server, it shows me the databases that are on that specific server. I am able to perform updates, deletes and inserts on all of these.
    In order to say create a server, i click on the name of a client and it brings me to the Server Interactive report to see the associated servers. I then click a "Create a Server" link that brings me to the create a server page. The issue i am having is that I would like to have the previous value of the primary key (Client ID) passed from the Server interactive report to the form where i create a new server so that the client ID is already populated in the Create a Server form. Presently, the only way i am able to do this is by defining the client ID column on the Create a server form as a select list and displaying ALL the different clients. By selecting a client name, this list then returns the client id associated with that client name. This is a potential source of confusion for the users and it would be much better if the client ID was already in a text field that is disabled and all they have to do is fill out the other fields of the form.
    I would greatly appreciate any help in this matter as I am fighting project deadlines. I have seen other examples that are similar, but i am still experiencing difficulty.
    Thanks,
    Tim

    Hi,
    I am still very confused as to how to get this to work.
    I cannot have the value passed by clicking the client ID link from the Server Interactive Report in order to populate the Client ID field in the Add Server Form. It MUST be done by clicking an Add Server button that will pass the value as well as take me to the Add Server Form. So far, I have only been able to have the value show up if i click the client ID column on the Interactive report that has a column link defined as follows:
    Name VALUE
    P9_CLIENTID #CLIENTID#
    However, when i do have the value passed this way i receive the following error message which proves that it is not saving the god damn state!
    ORA-01400: cannot insert NULL into ("USERS"."NEW_SERVERS"."ClientID")
    Error Unable to process row of table NEW_SERVERS.
    Even if the value appears in the text field, it isnt really there!
    How to make it know the value is there is beyond me.
    I dont know what to think of this situation. I have tried all types of settings and I have a feeling it will be 2010 before this is resolved.
    It is really frustrating, it has been days i am trying to get this to work...
    Thanks,
    Tim

  • Problem passing parameter from one interactive report to another

    Hi.
    I'm going slightly mad over this simple problem.
    Apex 4.0.2 installed. Created one interactive report with 4 columns, one is linked to a custom target which is another interactive report where the column is used in the WHERE clause through a hidden field value.
    This works fine in other applications on same Apex install, but not in this one.... Writing the hidden field to the screen shows that it gets the correct value from the first report, but the SQL-query returns no rows when querying on the :<parameter_name> value (there are rows in database - query runs fine when hard coding a value).
    Tried link column both directly from the column value link definition, and from the report definition - both pass value ok to hidden field, but SQL-query doesn't pick it up.
    Tried deleteing and recreating second report page, same problem.
    Anyone else had this problem? Are there any properties on the pages/fields that I've forgot to set, that may cause the session value not to be set when the query is running? I've got it working in other apps, and can't find anything done differently there....
    Regards,
    -Haakon-

    Yes, it shows the correct value. Also creating a second text field and assigning it the Source value of the hidden field shows the correct value in the textbox on page load.
    It's only the report's sql query that doesn't seem to get the value. Hard coding a document number (without hyphens etc) works fine, I get the expected records - so the rest of the query is correct.
    Tried '=' and LIKE - but still nothing...
    It's just the sql variable substitution of :P21_DOCNO that under no circumstance will work.... also tried a simple pl/sql block with the variable - nothing.... using the V('P21_DOCNO') - nothing....
    It seems like the sql query is parsed and run before the hidden field gets it's value or something....
    This is very strange - as it works in another application on same Apex installation.

  • 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

  • Showing current Date (Date Column) in the the filter of Interactive Reports

    Hi,
    I created a filter for the date column in my report (table column name is Process_Date). I have created a filter in the Interactive reports which populates the data from , a particular time perieod. (From_date - To_Date). How can I change the SQL query or the Report settings, so that when the user open a report it should poulate the data for the previous_day or sysdate-1 by default.
    Thanks in advance for your help.
    James

    christine275 wrote:
    ... (this is a time worked by date and not always entered on the date worked)--
    "Time" in Numbers is always "Time of Day", and is always part of a Date and Time value. "Amount of Time" is a Duration value, which may be displayed in a similar format to "Time of Day," but is a different type of value.
    If you are entering the number of hours and minutes worked, format the column as Duration, set the units and the format in which you want to have the value appear.
    The Date column will still contain a Date and Time value (Jan 1, 2011 00:00:00 in the cell shown in the example), but the "Time Worked" cells will contain only a Duration value.
    Incidently, the Date in A2 was entered as "jan 1" (without the quotes). Numbers automatically adds the current year and the default time value, then displays the result in the closest format to what you've entered, or in the Date and Time format you have chosen.
    The Duration value in B2 was entered as 3:15 (as displayed). Note that in the entry bar the duration is displayed as 3h 15m, probably to distinguish it from a similarly formatted (Date and) Time value.
    Regards,
    Barry

  • Unable to call a form from drill-down report

    hello
    i have a drill-down report, from where i wanna to call a transacation level form, so that user can modify the data from that transaction level form after seeing the result from report. After modification in data through form, report should be refreshed automatically.
    i am using form6i, can't user dde.app_begin because it starts a new session

    Hi,
    if this is for Forms on the web, just call the Reports from web.show_document() when closing the Forms (assuming you close the Forms after the update).
    If it is on client/server then you don't have a hook into Reports except you run a new Reports from Forms and close the Reports that called the Forms application (needs to be done within this Report)
    Frank

  • Opening & pre-populating a form from another form

    I am designing a form with Designer 7.0 whereby the user enters data into repeating subforms. This data is used to populate another form which repeats according to the number of instances created in the first form. I am wanting to create a button on the first form which the user can click so that the second form is opened and already populated with the data from the first form (which remains open). I am unsure how to go about this. Can anyone suggest some script which would get me started?

    You could also use OPEN_FORM(form_name,ACTIVATE,SESSION). This opens the second form in an independent session which will allow you to toggle between forms and commit on a single form only.
    Creating independent sessions is usually appropriate for forms that access different tables and independent logical transactions.
    The Oracle Forms Runform must be running with the Session option turned on when you use the session parameter in the OPEN_FORM call.
    Dpending upon your requirement, you may use OPEN_FORM or as Bogdan suggested use the RUN_PRODUCT with ASYNCHRONOUS option.

  • Populating a form from a text file

    I have an Oracle form which schedules students into courses. The form collects the student id, name, school, and course code. A "RUN" button then does the scheduling. The form is not a table, meaning the data is not all stored together in an Oracle table. The user currently has to manually enter each piece of information before a student can be scheduled. I would like to be able to auto populate this form/screen with data from a text file. I cannot use SQL Loader since the data is not going into a table. Is there a way to take my text file and make it appear on the form/screen when the form opens? Then my user just has to click the RUN button in order to schedule the students instead of hand entering all the data.
    Any help on this would be greatly appreciated!
    -NTW

    hi
    USING THE TEXT_IO PACKAGE
    Abstract: This document describes the functionality of the TEXT_IO
    package and explains how to use it to access the file
    system effectively.
    Keywords: TEXT_IO;FILE;IO;PACKAGE
    Using the TEXT_IO Package
    =========================
    Oracle Procedure Builder, "an integrated, interactive environment for
    PL/SQL", is shipped with several built-in packages which, if used
    properly, can greatly boost development productivity. These built-in
    packages are not installed as extensions to the STANDARD package;
    hence, when you reference a construct from any of these packages, you
    must prefix the package name to the construct.
    TEXT_IO provides constructs that allow programmers to read information
    from and write information to a file system. The procedures and
    functions in TEXT_IO fall into the following three categories:
    Category 1: File Operations
    FILE_TYPE - Declares a file type variable as a handle to the file being
    processed.
    Syntax: TEXT_IO.FILE_TYPE;
    FOPEN - Opens a file and returns a handle to the specified file of
    type FILE_TYPE.
    Syntax: TEXT_IO.FOPEN(file_specs VARCHAR2, file_mode VARCHAR2);
    The file mode can be R(read), W(write) or A(append).
    FCLOSE - Closes an open file.
    Syntax: TEXT_IO.FCLOSE(file_specs VARCHAR2);
    IS_OPEN - Checks if the specified file is currently open and returns a
    boolean.
    Syntax: TEXT_IO.IS_OPEN(file_type FILE_TYPE);
    Category 2: Output Operations
    PUT - Concatenates the supplied data to the current line of an open file.
    Syntax: TEXT_IO.PUT(file FILE_TYPE, data DATA_TYPE)
    Valid data types are VARCHAR2, DATE, NUMBER, PLS_INTEGER.
    All data except VARCHAR2 is converted to a character string.
    PUTF - Formats and writes a character string to an open file,
    doing a C-like substitution.
    Syntax: TEXT_IO.PUTF(file FILE_TYPE, format VARCHAR2,
    arg1[,...,arg5] VARCHAR2);
    Format is an optional parameter. If it is omitted, only
    one argument value can be passed.
    You can embed up to 5 "%s" patterns within the format string,
    which can be replaced by the corresponding strings
    (arg1 ... arg5) at execution.
    PUT_LINE - Concatenates the given argument string to the file
    followed by a newline character.
    Syntax: TEXT_IO.PUT_LINE(file FILE_TYPE, data VARCHAR2);
    NEW_LINE - Concatenates n number of newline characters to the current line,
    where n is the second argument with a default value of 1.
    Syntax: TEXT_IO.NEW_LINE(file FILE_TYPE, n PLS_INTEGER := 1);
    Note: If the file name is not specified each of the above cases, the
    output is directed to the Interpreter.
    Category 3: Input Given Operations
    GET_LINE - Reads a line from an open file into the parameter.
    Syntax: TEXT_IO.GET_LINE(file FILE_TYPE, data_item OUT VARCHAR2);
    Note: After a GET_LINE call, the file pointer moves to the next
    line and subsequent lines are read in after each call. If the
    line to be read exceeds the size of data_item, the VALUE_ERROR
    exception is raised. If no more characters can be read from the
    file, the NO_DATA_FOUND exception is raised. You cannot move this
    pointer back to the previous line though this can be simulated
    using your own buffer scheme.
    If a file name is provided for any of the above routines, this file
    must be accessible to Oracle Forms. In addition, you must provide the
    complete path. If no path is given, Forms assumes the file is in the
    current working directory and does not search for the file in the file
    system. The accessibility is determined as follows:
    On Windows, a TEXT_IO package function call only accesses local
    drives. It does not recognize any Universal Naming Conventions like
    \\machine_name\drive_letter. To access files on remote machines using
    the TEXT_IO package, map a letter to the remote drive through the File
    Manager.
    On UNIX, the absolute path must be given for the location of the file.
    Forms does not recognize relative paths provided for the file. This is also
    the case for VMS and other platforms. When you do not specify a path, Forms
    assumes the file is in the current working directory.
    For more information, refer to the TEXT_IO Package section in the
    "Oracle Procedure Builder Packages" chapter of the Oracle
    Developer/2000 Procedure Builder Developer's Guide Manual.
    Sample Form
    The following sample form explains some of the concepts and the
    syntax. The form reads in lines from a specified text file one at a
    time and displays them in a text item. It enables the user to parse
    the file by getting the next or the previous line. In addition, the
    user can write any line currently displayed to a specified output
    file.
    Create a single non-base table block. Put the following items and
    buttons on it. Create the appropriate boilerplate text for each item.
    All items go on the same canvas. No database connection is required
    for this application.
    Create the following text items:
    1. Name INPUT_FILE_SPECS
    Item Type Text Item
    Data Type Char
    Maximum Length 30
    2. Name LINE_READ
    Item Type Text Item
    Data Type Char
    Maximum Length 300
    3. Name OUTPUT_FILE_SPECS
    Item Type Text Item
    Data Type Char
    Maximum Length 30
    4. Name LINE_NO
    Item Type Text Item
    Data Type Number
    Maximum Length 30
    Create the following buttons and associated triggers:
    1. Name OPEN_AND_READ_FROM_FILE
    Label Echo file using TEXT_IO package
    Associated Button Trigger:
    Name WHEN-BUTTON-PRESSED
    Trigger Text:
    IF :input_file_specs IS NOT NULL THEN
    :line_no := 1;
    ECHO_TEXT_IO;
    ELSE
    MESSAGE('You must enter a valid input file name
    with a complete path');
    END IF;
    2. Name NEXT
    Label NEXT LINE
    Associated Button Trigger:
    Name WHEN-BUTTON-PRESSED
    Trigger Text:
    :line_no := :line_no + 1;
    ECHO_TEXT_IO;
    3. Name PREVIOUS
    Label PREVIOUS LINE
    Associated Button Trigger:
    Name WHEN-BUTTON-PRESSED
    Trigger Text:
    IF :line_no = 1 THEN
    MESSAGE('You are on the first line of the file.');
    ELSE
    :line_no := :line_no - 1;
    TEXT_IO.FCLOSE(variable_declarations.infile);
    /* Close the file then reopen it with the
    ECHO_TEXT_IO package. This resets the
    file pointer. */
    ECHO_TEXT_IO;
    END IF;
    4. Name WRITE_LINE_TO_FILE
    Label WRITE CURRENT LINE TO Output FILE
    Associated button trigger:
    Name WHEN-BUTTON-PRESSED
    Trigger Text:
    IF :output_file_specs IS NOT NULL THEN
    write_to_file;
    ELSE
    MESSAGE('Must enter a valid output file name with
    complete path');
    END IF;
    Create the following program units and package specifications:
    1. ECHO_TEXT_IO* (Procedure Body)
    PROCEDURE echo_text_io IS
    -- infile TEXT_IO.FILE_TYPE; /* Not used in this program */
    linebuf VARCHAR2(300);
    line_counter INTEGER;
    BEGIN
    line_counter := 0;
    Note that the IF condition would be redundant if you use
    a local variable (commented out above) to save the file pointer.
    Infile is a local variable, so the binding would be lost each
    time you exited the program. The use of package variables
    to act as global file type handles resolves this problem.
    IF TEXT_IO.IS_OPEN(variable_declarations.infile) THEN
    If the file is open, read in the next line.
    TEXT_IO.GET_LINE(variable_declarations.infile, linebuf);
    line_counter := line_counter + 1;
    ELSE
    The file is closed for the application when you display the
    previous line; see the WHEN_BUTTON_PRESSED trigger on the
    PREVIOUS item. Since the file pointer cannot move
    backwards, you must reset the file pointer and loop to the
    specified line.
    variable_declarations.infile := TEXT_IO.FOPEN(:INPUT_FILE_SPECS, 'r')
    -- variable_declarations.infile := TEXT_IO.FOPEN('c:\autoexec.bat', 'r')
    /* You can also hard-code the value */
    WHILE line_counter < :line_no LOOP
    TEXT_IO.GET_LINE(variable_declarations.infile, linebuf);
    line_counter := line_counter + 1;
    END LOOP;
    END IF;
    :line_read := linebuf;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    MESSAGE('End Of File reached.');
    :line_no := :line_no - 1;
    WHEN OTHERS THEN
    MESSAGE('UNHANDLED EXCEPTION RAISED in ECHO_TEXT_IO
    procedure - Check the file name');
    MESSAGE('U. E. R.');
    END;
    2. VARIABLE_DECLARATIONS (Package Spec)
    PACKAGE variable_declarations IS
    The following declarations are public and, hence, visible
    to the Forms application.
    infile TEXT_IO.FILE_TYPE;
    outfile TEXT_IO.FILE_TYPE;
    line_number NUMBER;
    END;
    3. WRITE_TO_FILE* (Procedure Body)
    PROCEDURE write_to_file IS
    BEGIN
    IF NOT TEXT_IO.IS_OPEN(variable_declarations.outfile) THEN
    variable_declarations.outfile := TEXT_IO.FOPEN(:OUTPUT_FILE_SPECS, 'a');
    END IF;
    TEXT_IO.PUT_LINE(variable_declarations.outfile, :line_read);
    END;Sarah

  • Linked column with # sign doesn't work in report results

    I have a 2 page query situation, whereas in the 1st page I have a wildcard query to find a product number.
    This product number is set-up as link to run a report which opens in another page.
    (Type is a STRING.)
    Everything works fine unless the product number starts with the # sign.
    I can run a report using this in a non-linked page, but it doesn't work in the linked page...?
    Simple queries
    Page 1
    select
    from
    Products
    WHERE (((upper(TOP_ITEM) like upper(:P1_SEARCH)||'%')))
    and :P1_SEARCH is not null
    (Link on Top Item - :P2_Search)
    Page 2
    select
    from
    Products
    where Top_Item = :P2_Search
    (This works fine if I enter the #[Product] into the text field)
    Link doesn't work...?

    You need to escape the "#" character in the product no and generate the link's HTML code in report #1 directly within the SQL query.
    select ..
       ,'<a href="f?p=REPLACE(product_number,'#',''%23)
      ,'<a href="f?p=' || :APP_ID || ':200:' || :APP_SESSION || '::NO::P200_PRODUCT_NUMBER:' || REPLACE(product_number,'#','%23') || '"> Link</a>' product_number_link
    FROM ..
    {code}
    <i> 200 is report #2's page
    P200_PRODUCT_NUMBER is report #2's page item which is set on redirecting to that page.
    Product_number is the column name of column with '#' characters
    Change display type of product_number_link column to "standard report type"</i>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to open a form from Oracle XML Report .xls Output?

    Hi All,
    We have a requirement wherein we have one complex SQL query, requirement is to fetch the data from that query and show it to the user. So far, so good. We can either create a report thru' UTL file to show the output to the user or can create a XML report whose output can be in the excel format.
    Now user wants to have a hyperlink i.e. when he clicks the BSA (Blanket Sales Agreement) from the report output, it should be able to route him to BSA screen (oracle form), so that he can directly correct the issue with that corresponding BSA on which he clicked.
    i.e. requirement is to create a a hyperlink from report output which will route the user to that oracle form with the BSA queried.
    Not sure how can we implement this. If anybody has come across this type of requirement, please share your ideas and the approach used so as to accomplish this. Any inputs on this will be highly appreciated.
    Cheers!
    -Sumir

    Hello Sumir,
    we create reports in an XML format using http://matzberger.de/oracle/spreadsheet-en.html.
    Within these files you can create hyperlinks to a forms application like
    http://<applicationserver>/forms/frmservlet?config=xy&p_autoinit_module=ab&p_autoinit_arg=123
    With these parameters we call a default forms module (welcome screen) and then start module ab and execute a query for 123. The user then can directly access the data he needs.
    Regards
    Marcus

  • Column Headings on 2 line with Interactive reports

    I neecd to have my column heading take up two line (wrap), Like this:
    Order
    Time
    I can do this with :Order </br>Time" but the "</br>" tag now shows in the all the Interactive dropdowns.
    Any idea on how to get around this?

    Thanks for the help Ravi, but I tried that and it did not work. However I want to focus back on the real topic of this post.
    I need to have my colum headers wrap to more to more then one line with out showing the "br" tag in the column dorpdown lists.

Maybe you are looking for