New to Oracle Report .....run/display 2  queries depending on parameter

I am developing 2 report where the output is almost same except for 2 rows .Those 2 row should be extracted from Employee table if the parameter specified is E or should be extracted from Salary table if parameter specified is S.
In short the report should look like
parameter E
----------1----------------
MICROSOFT
Bill Gate
United States
Huge organization
Employee
George Bush
Dick Cheney
parameter S
----------2----------------
MICROSOFT
Bill Gate
United States
Huge organization
Salary
100000
200000
Please advice as how to go about doing this.

Well, if it's only about 1-2 non-repeating values that need to be computed and displayed conditionally, then, the best approach would be to have for them two user parameters, such as :p_u1 and :p_u2.
Then, say in the afterpform trigger you may have something like:
if :p_s='S' then
--- those below being selects that return single values
select ... into :p_u1 from ... where ...
select ... into :p_u2 from ... where ...
end if;
Then, for having the values conditionally printed, you may use the format trigger for the fields, or, eventually, for the frames that contain the fields and some aditional text that is to be printed.
If it's to be a query that returns a number of rows that has to be conditionally printed, then, in the query you may put an aditional condition in the where clause. And in the layout you may put the repeating frame for that query and tha column headers text within a frame that has a format trigger for printing conditionally.

Similar Messages

  • New to oracle report builder

    Dear all;
    Please pardon me. I am new to oracle report builder and I am trying to accomplish the following. First and foremost please find my pl/sql queries below. Kindly note, all the queries have been tested and I just need to be able to input those queries into the report builder. Thank you.
    create or replace package test1 is
    type r_cursor is ref cursor;
    function report(company_name in varchar2) return r_cursor;
    end test1;
    create or replace package body test1 is
    function report(company_name in varchar2) return r_cursor as
    my_r_cursor r_cursor;
    begin
    if(company_name = 'ALL COMPANIES') THEN
    open my_r_cursor for
    select t.t_id, t.t_description from t1 t;
    return my_r_cursor;
    elsif(company_name != 'ALL COMPANIES') THEN
    open my_r_cursor for
    select t.t_id, t.t_description from t1 t
    where t.t_id = company_name;
    return my_r_cursor;
    end if;
    end;
    end test1;
    create table t1
    t_id varchar2(200) not null,
    t_description varchar2(250),
    primary key(t_id)
    insert into t1
      (t_id, t_description)
    values
      ('CITI', 'PROFIT: 2.2Billion');
    insert into t1
      (t_id, t_description)
    values
      ('GE', 'PROFIT: 1Billion');
    insert into t1
      (t_id, t_description)
    values
      ('JPMORGAN','PROFIT: 0');Now, I am trying to create a simple report in oracle report builder. The interface for generating for this report is basically, there is a dropdownlist where by the user picks a company name from the dropdownlist and clicks on the go button, this should then generate a report with the above query shown in the package. How can this be achieved? All help will greatly be appreciated.

    Hi,
    first of all you need strong typed ref cursor, oracle reports need to detect witch are the columns returned by your cursor.
    so first you create your package
    create or replace package test1
    as
    TYPE t_record IS RECORD ( company_number PLS_INTEGER--TABLE_NAME.COLUMN_NAME%TYPE
    , company_desc VARCHAR2(150)--TABLE_NAME.COLUMN_NAME%TYPE
    TYPE T_REF_CURSOR IS REF CURSOR RETURN t_record;
    procedure report(company_name in varchar2 ,cur_out OUT t_ref_cursor) ;
    end test1;
    show errors
    create or replace package body test1
    is
    procedure report(company_name in varchar2 ,cur_out OUT t_ref_cursor)
    is
    my_r_cursor T_REF_CURSOR;
    begin
    if(company_name = '1')
    THEN
    open my_r_cursor for
    select 1 as t_id, 'description' ast_description from dual
    else
    open my_r_cursor for
    select 2 as t_id, 'description2' as t_description from dual
    end if;
    end;
    end test1;
    show errors
    then, in your report you create a ref cursor query :
    function QR_1RefCurDS
    return test1.t_ref_cursor
    is
    C_return test1.t_ref_cursor;
    begin
         test1.report(1,C_return);
    RETURN(C_return) ;
    end;
    hope this helps you !
    E

  • Oracle Reports to display in IE 5.5 browsers

    Oracle reports (6i) display fine in IE 4/5.0 browsers, butr those with 5.5 display a blank screen.

    hello,
    there are some issues with showing PDFs produced by the reports server in IE55 that should be solved with one of the latest patches.
    please check this issue with oracle support services.
    regards,
    the oracle reports team

  • New to Oracle reports...

    Hi everyone,
    I am new to oracle reports.i am following this document
    http://download.oracle.com/docs/cd/B14099_10/bi.1012/b13895/orbr_tab.htm
    where can i find the .SQL file of the tables and data for the examples given in that document.I am trying to practice those but dont have tables and data.
    Thanks in advance.
    phani

    Excerpt from : http://download.oracle.com/docs/cd/B14099_10/bi.1012/b13895/preface.htm
    Accessing the Data Sources
    The data sources used in this manual are:
    -SCOTT schema
    -Sample Human Resources, Sales History, and Order Entry schemas
    -Summit Sporting Goods (SUMMIT) schema
    The SCOTT, Human Resources, Sales History, and Order Entry schemas are available with the Oracle Database (both 9i and 10g).
    SUMMIT Schema script :
    http://otn.oracle.com/products/reports/htdocs/getstart/examples/Tools/demos60.zip

  • Oracle reports to display PDF/Excel files stored in the Database

    can we use Oracle reports to view/display PDF/Excel files stored in the Database? Thanks Lalitha

    A document stored in the database can be easily retrieved in or via the browser using mod_plsql. Simplified:
    select content, mime_type
    into v_blob, v_mime_type
    from ...
    owa_util.mime_header(nvl(v_mimetype,'application/octet'),false);
    htp.p('Content-length: ' || dbms_lob.getlength(v_blob));
    owa_util.http_header_close;
    wpg_docload.download_file(v_blob);So, the link in your report should point to this database procedure.
    Edited by: InoL on Mar 1, 2011 4:17 PM

  • Oracle Reports : Run time error when there is a call to DBMS_LOB package

    I am facing a strange issue, please do share if you have some inputs. When I try running the compiled RDF report(Generating XML to be specific), Oracle Reports Builder crashes when I make use of the following formula function. Strangely, this works fine in the backend. Moreover I tried debugging and by trial and error method found out that, when there is a call to the DMBS_LOB package it errors (works fine when this is commented). Please do let me know whats the root cause of this issue. Thanks in advance
    function CF_ClientSignatureFormula return VARCHAR2 is
    file_name BFILE;
    dir_name VARCHAR2(100);
    dest_file_name VARCHAR2(100);
    dest_path VARCHAR2(400);
    begin
         SELECT client_signature
              INTO file_name
              FROM xxfpr.fpr_rcp_bank_details frb,
              Xxfpr. fpr_rcp_gtn_rpt_map frm
              WHERE frb.record_id = frm.bank_record_id
              AND frm.gtn_request_id = :p_gtn_request_id;
    SYS.DBMS_LOB.filegetname(file_name,dir_name,dest_file_name);
    SELECT directory_path INTO dest_path FROM all_directories where directory_name = dir_name;
    dest_path := dest_path || '/' || dest_file_name;
    return dest_path;
    EXCEPTION
         WHEN OTHERS THEN
              RETURN NULL;
    end;
    Thanks,
    NirmalGeo

    And what version of Reports are you using?
    BFILES are accessible from the database, not the client (Reports). So, put your code in the database.

  • List of Oracle Reports run through Oracle Portal.

    Hi,
    It's possible that I am posting my message to a wrong Forum. If that's so, please let me know (and the correct forum too).
    I have several Oracle Reports that are run through Oracle Portal (when user clicks a link for a report). I want to get a list of all such Oracle Reports in one go as I need to modify all of them. At the moment, to get the actual report name that I need to modify I am following the steps below.
    When I am at 'Oracle Reports Security' page (in the Portal) where there is a section 'Reports Definition File Access',
    1. I click list icon without entering any value in the box. It shows me a list of all report definitions.
    2. After selecting a report definition, and clicking Edit, it shows me 'Manage Component' page. There are several links available. One of them is 'Edit'.
    3. I click 'Edit' and it shows me the actual 'Oracle Reports File Name'. This is the file I need to work on.
    But instead of following the above steps for each of the several reports I need to modify, is there any way, say by running a SQL query, to find out the actual Oracle Reports file names?
    The 'Manage Component' page shows 'Run Link' and links for 'PL/SQL source'. I tried to search for the schema name and package name in the database (by connecting as SYS user). However, I found neither the Schema not the Package.
    Hope my question is clear. In brief, I want to get a list of Oracle Reports file names that are run through Oracle Portal.
    Any questions, please let me know.
    Thanks and regards,
    Manoj.

    Jim,
    Did you ever try to add Reports portlet as an item, so that user can click on each item to customize/schedule the report? You can have 50 of them, if that is what you really need.
    Any reason why you want to create custom user interface, instead of using this vehicle that Portal provided by default?
    You mentioned "The report Portlet ... does not allow customization." Actually, it does. You can do it by clicking on the Customize link of the Reports portlet.
    Hope this helps,
    -Jeff

  • Oracle report runs correctly via report builder but call report via form with parameters skips one of the plsql formula

    Hello everybody,
    I created a oracle report i.e Bank Book having banks transactions receipts and payments and opening balance w.e.f 01-jul-2014. parameters are bank code, from_date and to_date. opening balance calculates (return ope from table bankinfo +total receipts-total payments). reports runs correctly via report builder. balances are ok. but the problem is when i run this report via oracle form opening balance return only ope from table bankinfo and skips total receipts-total payments.....
    i dont think so why this happend at all. some body help me...
    thanks
    Abdul Salam

    Hi ,
    This community is to discuss Oracle Application Server specific issues, you can post this query in for better response:
    Oracle Reports (MOSC)
    Regards,
    Prakash.

  • Connectivity of Websphere with Oracle reports running on Oracle 9i AS

    How can we connect to Oracle Reports services and in turn generate reports; by accessing it from an application running in websphere, which is running on different machine in the same network. Our environment is such that we are forced to use these two application servers.

    we're currently looking at building the reports j2ee thin client for ibm websphere - however do not have a scheduled date for this. you can see if the j2ee thin client meets your requirements by looking at the doc for it for the bea client:
    http://otn.oracle.com/products/reports/htdocs/getstart/examples/Tools/thinclient/bea/Readme.html
    is something like this for websphere what you are looking for?
    thanks
    paul narth
    oracle reports & portal product management

  • Oracle Reports running very slow

    The same Oracle reports, which used to take 15 seconds to complete, now takes about 4 minutes to complete. Any ideas? Thank you.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JS:
    Thank you for your reply. Could you be more specific about network problem? We've changed our web application server and reports server settings recently. What could cause network problems? <HR></BLOCKQUOTE>
    Well, I would suggest that you got to be very clear with the query. Most of the report peformace is based on the query.
    1. Make sure that query is fine and note down the time it takes.
    2. If first step is clear and if you are happy with the output that is process time, then you can think about tuning the report.
    ( You may want skip this step)
    3. If that does not work you can investigate
    what kind of array it uses and network speed and other thinks. I am not really familior with these set up.
    Good luck with it..
    Regards ...
    Krishna ...
    null

  • Oracle Report running on Web

    i want to generated a database report which will run on Web. is it sufficient to install Oracle Client 8.1.7 or do i need to install any other components seperately?
    thanx

    you need the report server to run reports on the web.
    check out "New Features in Oracle9iAS Reports Services and Oracle iDS Reports Developer 6i"
    on http://otn.oracle.com/sample_code/products/reports

  • Oracle report running total Resseting balance

    Dear All,
    I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
    In brief
    Asset 1
    cost Deprciation Adjusted Cost
    50 - 2 48
    48 -5 45
    45 - 4 41
    I achieved that by using
    if :p_val is null then
    :result := nvl(:cost,0)-nvl(:depriciation,0);
    :P_val :='5';
    return :result;
    else
    :result := nvl(:result,0)-nvl(:depriciation,0) ;
    return :result;
    end if;
    working fine
    But problem is when the next asset start on same report
    Asset 2
    cost Deprciation Adjusted Cost
    100 5 36
    it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
    Oracle Champs pl advice me how to solve this.
    I really dont got any idea how to solve this.
    thanks

    Dear,
    Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
    thanks

  • Oracle report running total Resetting balance on next group

    Dear All,
    I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
    In brief
    Asset 1
    cost Deprciation Adjusted Cost
    50 - 2 48
    48 -5 45
    45 - 4 41
    I achieved that by using
    if :p_val is null then
    :result := nvl(:cost,0)-nvl(:depriciation,0);
    :P_val :='5';
    return :result;
    else
    :result := nvl(:result,0)-nvl(:depriciation,0) ;
    return :result;
    end if;
    working fine
    But problem is when the next asset start on same report
    Asset 2
    cost Deprciation Adjusted Cost
    100 5 36
    it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
    Oracle Champs pl advice me how to solve this.
    I really dont got any idea how to solve this.
    thanks

    Dear,
    Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
    thanks

  • Oracle Report: columns display one after another.

    Hello
    I have a report that has 10 columns. I want all of the rows of first set of 5 columns to display then the second set of 5 columns will display after that. for example
    Date range 1/1/07 to 1/5/07
    col1 col2 col3 col4 col5
    AA BB CC DD CCC
    AA VV DDD DD XXX
    Date range 1/6/07 to 7/10/07
    col6 col7 col8 col9 col10
    AA BB CC DD CCC
    AA VV DDD DD XXX

    Hallo,
    In the sense of Applicatin Express you have two Report Regions.
    Both regions can be dependent on a master item (e.g. SELECT ... WHERE MASTER_ID = :MASTER_ITEM)
    Hope that helps, Willi

  • Error in running oracle report on APPS due to print style

    Hi
    i have an oracle report which displays about 550 rows of data...When i try to run it with oracle apps i selelect landwide but i get an error as the defined style can not print that much amount of rows.Is there any toher style which prints this many amount of rows or i have to create a new print style.
    thanks
    isha
    Edited by: 791666 on Aug 30, 2010 8:33 AM

    Please tell us about your product, version and Application Server type. You may also want to note that Oracle Apps is different from Oracle Application Server .
    Also intriguing is the error you report. Where and what exact error do you get? Error codes/messages need to be reported exactly (not paraphrased).
    Was that in displaying the info or in printing it to a printer?

Maybe you are looking for