Interactive report based on dynamic query

Hello
I am using Apex 4.1 and have a requirement to create an interactive report based on a dynamic query. This option is available in Classic report but in Interactive this feature is not there. Tried using collections or just a view (thought of changing the view definition during "On load", but structure of the report is already defined based on the definition of the view at design time).
Is there any way of achieving this?
Appreciate any help!
Thanks
aks

Try looking at this: http://rakeshjsr.blogspot.com/2010/10/oracle-apex-interactive-report-based-on.html
Thank you,
Tony Miller
Dallas, TX

Similar Messages

  • How to - Build a report based on dynamic query

    I am using this how to and find out that there is an syntax error on this example, where the and should be where. I got an SQL parsing error when I followed this example until I debugged with the debug while on this page. Has any one using this how to and have the same problem?
    if :p600_show != 'ALL' then
    q:=q||'and p.category = :p600_show';
    end if;
    declare
    q varchar2(4000);
    begin
    q:=' select p.category, ';
    q:=q||' p.product_name, ';
    q:=q||' i.quantity, ';
    q:=q||' i.unit_price ';
    q:=q||' from demo_product_info p, ';
    q:=q||' demo_order_items i ';
    q:=q||' where p.product_id = i.product_id ';
    if :p600_show != 'ALL' then
    q:=q||'and p.category = :p600_show';
    end if;
    return q;
    end;

    [regarding bind variables]
    Well, from what I saw in
    http://www.oracle.com/technology/products/database/htmldb/howtos/dynamic_report-1.6.htm
    the dynamic SQL is constructed by doing concatenation of user input and SQL keywords
    'select col1,col2 from table where co1='||:P1_COL1
    So, this is going to flood the shared pool with unique SQL statements with different values of :P1_COL1 and also subject to SQL injection, isnt it? You obviously disagree and I am happy to be proven wrong, please do so?
    To avoid having to deal with SQL parsing errors, you
    could put a condition on the region so that it
    doesn't render (parse) whenever any elements of
    session state are not sufficiently populated to allow
    the formation of a valid SQL query that would be
    parseable without errors.Thats exactly what I want to do, but didnt know what condition that would be? I didnt see any condition saying "Session state not initialized" or something like that.
    Thanks

  • Report based on dynamic query

    I have done the same way as shown in the 'How To document'. But it does not work. It just ignores what is mentioned inside the if-end if construct. I have used the sample application itself and followed exactly what is mentioned in the article.The output is the same for 'ALL' as well as any other category selected.
    I have observed that in the report region, the report type namely 'PL/SQL function body returning SQL Query', the if construct just does not work as expected. The code is accepted without throwing any errors but, the result is only one half works, mostly the if portion, what follows the else is ignored.
    I am not sure whether i am committing a mistake somewhere or there is a bug in the application builder itself.
    Can anybody throw light on this.
    I am using application express 2.1 version

    Thanks for your response.
    The How-to document that referred is available here in the following url:
    http://www.oracle.com/technology/products/database/application_express/howtos/dynamic_report.html
    the PL/SQL code is given below. P22_show is the item name(select list).
    declare
    q varchar2(4000);
    begin
    q:=' select p.category, ';
    q:=q||' p.product_name, ';
    q:=q||' i.quantity, ';
    q:=q||' i.unit_price ';
    q:=q||' from demo_product_info p, ';
    q:=q||' demo_order_items i ';
    q:=q||' where p.product_id = i.product_id ';
    if :p22_show != 'ALL' then
    q:=q||'and p.category = :p22_show';
    end if;
    return q;
    end;

  • Conditional Display of Interactive Report Based On Different SQL Query

    Hello,
    I have two drop down list on top of my page and below that I have a interactive report.
    Based on user selection of values from drop down, interactive report should change based on different SQL queries.
    Is it possible to have different SQL queries based on values from drop down and generate interactive report based on that?
    Thanks

    I am passing my drop down value to apex_collection like the following:
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY( p_collection_name => 'IR_LIST',
    p_query => REQUEST_VIEW(:P12_VIEW));However when I change the values from the drop down, :P12_VIEW is not getting the value from drop down even though I could see value being changed in URL. I have created page process for apex_collection
    Process Point - OnLoad - Before Header
    Run Process - Once Per Session or When ResetCould someone suggest as why I cannot get the values in function when drop down is changed?
    Regards

  • Require assistance in Interactive Report based in APEX 3.2

    Hi All,
    Thanks in advance
    I have created editable Interactive report based on Form with report .
    once report created , I have modified query with the column named TempNetto ,Temp Brutto .. Below is the query
    select "IDSUB",
    "JAHR",
    "IDMITARBEITERLISTE",
    "EKPREIS",
    "WEBUCHUNGEN",
    (WEBuchungen*EKPreis) TempNetto , --modified
    "NETTO",
    DECODE((WEBuchungen*EKPreis),0,0,(Netto+(Netto*VerwaltungskostenZuschlag)+(WEBuchungen*InfrastrukturkostenZuschlag))) TempBrutto, --modified
    "BRUTTO"
    from "#OWNER#"."SUBS"
    I receieved the below message "You have requested to change the Interactive Report query. If you added columns to the query, they will not be displayed when the report is run. You will need to use the actions menu and either select the columns or click Reset. If you removed any columns from the query, it will disable existing filters, highlight rules, and other report settings referencing those columns. Please confirm your request. "
    I want the column started with temp should appear in report . I have checked under search bar Action menu is checked and options like Select column and Reset is checked
    Kindly provide some help
    Cheers
    Sachin

    Hi,
    When you've selected all the columns (Select Columns) you then need to save the report...not reset it. Go back and make sure all columns are on the right and then:
    - Save Report
    - As Default Report Settings
    - Apply
    Mike

  • Interactive Report Based On A Collection

    Hi guys
    Using Apex 3.2
    I have a classic report based on a collection, which works fine.
    I am now trying to create an interactive report based on the same query (collection), but no data is returned.
    I there anything special I need to do with an interactive report.
    Cheers
    Gus

    Go into Interactive Reports Actions Menu > Select Columns > Add all missing columns to right side and apply (Display In Report)
    OR
    Check interactive report attribute settings
    Thanks

  • Interactive report - Function returning SQL query

    i notice that it is not possible to create an interactive report based on a function call. can anyone shed any light on why this is?
    also, is there a work around possible? i really dont want to store my SQL query inside a page in the application

    Craig,
    I tried the collection workaround as well but noticed that it gets incredible slow when data sets grow bigger. Depending on what you need maybe my solution is of help for you:
    I used multiple subpages with interactive reports, an iframe and a javascript function setting the iframe-src on the main page, see my last post on
    interactive report custom GO-Button (-process)
    Paul

  • Bold a single row in a Report based on SQL Query

    Should be easy? So, how do I bold a single row in a report based on SQL query without creating a new template or writing Java for the page? What is the Tabular Form Element "Element Attributes" field for? Or what am I supposed to put in there to make it do anything?

    One way to do this is to add a hidden column to your report which contains the formatting value, for example:
    select empno
    , ename
    , sal
    , decode(empno,1,'font-weight:bold','font-weight:normal') style
    from emp
    Hide the STYLE column.
    Then you can use this column for each column in Column Formatting > HTML expression in this way:
    <span style="#STYLE#">#SAL#</span>
    Unfortunately you have to do this for each colum you want to appear bold.
    good luck,
    Dirk Dral

  • How to bulid a Crystal report based on Bex query as source

    Hi,
    I have requirment where the end user wants the query in Crystal.I built a Bex query in Bex query designer.I would like to know how to create crystal report based onthe Bex query.
    Thanks,

    Hi
    The Crystal Reports are integrated with BW such that the query built in BW can be used to bulit Crystal Reports on them.
    After launching the Crystal Reports, you will have and option : "Open reprt from BW" whcih will help you in opening the BW Queries and create Crystal Reports.
    Also in the Menu there is an optin SAP-->Create New Report from a Query
    Regards, Hyma
    Edited by: Hymavathi Yanamadala on Aug 13, 2009 5:52 AM

  • Interactive Report based on a function returning SQL query?

    Hi guys!
    I'm wondering if the IR based on a function returning SQL query will be available on the final release of APEX 4.0..I can't see this functionality in EA1 and EA2 and I think it should be there..dont you think?
    With regards,
    PsmakR

    Hi!
    You're absolutely sure you're talking about the Interactive Report region and not about the default SQL Report region ?
    With regards,
    PsmakR

  • Generating report based on dynamically generated sql query

    I have to rewrite asp reports to oracle reports.
    The original application has forms in asp where reports are generated dynamically based on the options selected.
    There are many options to select.
    Some add filter criteria to where clause.
    I have no problem with this. As i can generate report using parameter form.
    whereas i don't know how to generate reports whose columns change based on the user selection.
    The front end screens are going to be in java and jsp pages. The only way i can think of is generating reports on all possible options the user may select. But, as there are more than 15 options, i think this is not the right approach.
    How can i achieve this.
    Thank you very much.
    navya.

    One method that comes to mind would be to use an after parameter form, and use lexical parameters to create dynamic statements.
    For example in your after pform:
    If :P_NAME = 'JOHN' then
    :P_SELECT = 'SELECT COL1, COL2 ';
    :P_FROM = 'FROM JOHN ';
    :P_WHERE = 'WHERE COL3 = 'JOHN';
    END IF;
    Then in your query, you could say:
    &P_SELECT
    &P_FROM
    &P_WHERE
    Something like that - If only parts of you where statement will change, you can just write that one part -
    like
    IF :P_STATE is not null then
    :P_STATE = ' and table.state = :P_STATE_IN ';
    else :P_STATE = ' and 1=1 ';
    end if;
    and in your query...
    where....
    &:P_STATE
    So IF a person enters a state, then limit the search to that state, or else do a 1=1.
    Hope this gives you a start

  • Interactive Report based on View

    Hello!
    I've just started to rewrite my Forms applications to Apex.
    Based on an existing view I want to create an Interactive Report, but there is only the choice between 'Table' and 'SQL statement'.
    Is there a way to use the view in a direct manner ( not in a sql statement as 'select * from VIEW)?
    Regards
    Pietja

    Hello Pietja,
    In my APEX env (3.2) an IR can only be based on a SQL Query. You can use the Query Builder to select a table or view, but still it ends up with a SQL Statement.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Change source (sql) of interactive report based on column value?

    I've got an Interactive report displaying 10 columns. What I'd like to do is show different columns depending on the value of the first column. All the rows in the result will have the same value in the first column.
    If value in column 1 (on any row) = 'aaaa' then
    display columns 1,2,3,4, 9, 10
    If value in column 1 (on any row) = 'bbbb' then
    display columns 1,2,3,4, 7, 8
    If value in column 1 (on any row) = 'cccc' then
    display columns 1,2,3,4, 5, 6
    Should i somehow make the sql query dynamically change or can I use apex to dynamically hide the columns I don't want in the interactive report?
    Appreciate if you could point me in the right direction...
    /A

    Hello Andy,
    You can solve that in your SQL query:
    select col1, col2, col3, col4
    ,   case col1
        when 'aaaa' then col9
        when 'bbbb' then col7
        when 'cccc' then col5
    end newcol5
    from tableYou may have to use to_char or to_number conversions when the datatypes of the col5,7 and 9 are different.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Interactive Report based on pl/sql function body

    Can an interactive report be based on a pl/sql function body returning the query sql? Or does it have to be based directly on the SQL?
    Thanks

    Hello "unknown user",
    As far is I know an Interactive Report can only be based on 'regular' SQL. If you have a Report based on a 'PL/SQL function body returning SQL' the option to migrate the report to an interactive report is not there.
    Regards,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • How to select records from Interactive Reports based on checkboxes

    Referring to the link below
    http://apex.oracle.com/pls/otn/f?p=31517:95
    I want to select rows from the Interactve Report based on a checkbox. This demo page has 2 sections, one for classic report and other for interactive one. The classic report is able to select the whole records but the interactive report selects only the emp nos. I am looking for a functionality where I can select the whole record from the interactive report.
    Any pointers will be helpful.
    Thanks

    That is easy. You should just modify the query:
    DECLARE
       v_count   INTEGER := 0;
    BEGIN
       :p95_text_ir := NULL;
       FOR i IN 1 .. apex_application.g_f20.COUNT
       LOOP
          v_count := v_count + 1;
          FOR c IN (SELECT ename, job, mgr, sal, deptno
                      FROM emp
                     WHERE empno = apex_application.g_f20 (i))
          LOOP
             :p95_text_ir :=
                   :p95_text_ir
                || 'ID: '
                || c.empno
                || ' / '
                || 'Name: '
                || c.ename
                || ' / '
                || 'Job: '
                || c.job
                || ' / '
                || 'Manager: '
                || c.mgr
                || ' / '
                || 'Salary: '
                || c.sal
                || ' / '
                || 'Department: '
                || c.deptno
                || CHR (10);
          END LOOP;
       END LOOP;
       :p95_text_ir := :p95_text_ir || ' / Records selected: ' || v_count;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

Maybe you are looking for

  • Unit testing UIX

    Hi Steve Can you advice me a tool for unit testing my UIX pages apart from HttpUnit and HtmlUnit frameworks? HttpUnit gives javascript errors. HtmlUnit is not practical for the complex HTML produced from a UIX page. Thanks

  • How can I make firefox remember passwords on ALL sites?

    Firefox has a feature to remember my passwords, which is very useful. However, some sites mess with this so they won't save my passwords. In some cases these sites turn "autocomplete" off for the password field in their html; in other cases they appe

  • How can I set up a unique signature for each email account?

    Is Apple kidding me? I can put multiple email accounts on my iPad but they must all have the same signature, bcc settings etc... That makes this a toy not a tool! Is there an app for that? RA

  • Connection to server Problem with JWS

    Hi All I have an applet client and a server side. when i lunch the applet with Appletviewer or from its Web page, the connection between the server and the client applet works well. I have successfully lunched it with Java Web Start, BUT the server s

  • How do I delete facetime beta in Lion

    I was just wondering if anyone had any idea how to delete the facetime beta in Lion.  I would like to update to the actual app instead of the beta but I can't figure out how to delete the beta in order to do so.  Any thoughts? Thanks Josh