Dynamic interactive report

Hello

I have a requirement to create the financial report of pivot using interactive report. I managed to create a function retutning the dynamic query for the report of pivot as follows:

CREATE OR REPLACE FUNCTION
fnc_pivot
RETURN VARCHAR2 AS
CURSOR cur_qry IS
SELECT DISTINCT', SUM (CASE WHEN financial_year = "')
|| financial_year
|| "' ' AS case_st
(' THEN annual_allocation END) AS
||'"'
|| financial_year
||'"' AS case_head
OF finance_table
ORDER BY case_head;

l_query VARCHAR2 (32000) DEFAULT NULL;
BEGIN
BECAUSE me IN cur_qry
LOOP
l_query: = l_query
|| i.case_st
|| i.case_head
|| CHR (10);
END LOOP;
l_query: = 'SELECT id.
|| l_query
|', ' SUM (annual_allocation) AS
||'"'
||' Total general '
||'"'
||' OF finance_table '
||' GROUP BY id';

Return (l_query);

END;

Which returns the following query:

SELECT fin._id, SUM (CASE WHEN fin.financial_year = ' 2007/8 ' THEN fin.annual_allocation END) AS "2007/8.
, SUM (CASE WHEN fin.financial_year = ' 2008/9 ' THEN fin.annual_allocation END) AS '2008/9 '.
, SUM (CASE WHEN fin.financial_year = ' 2009/10 ' THEN fin.annual_allocation END) AS '2009/10 '.
, SUM ("CASE WHEN fin.financial_year = ' 2010/11" THEN fin.annual_allocation END) AS "2010/11"
, SUM (CASE WHEN fin.financial_year = ' 2011/12 ' THEN fin.annual_allocation END) AS '2011/12.
, SUM (CASE WHEN fin.financial_year = ' years future "THEN fin.annual_allocation END) AS"Future Years ".
SUM (annual_allocation)
OF end financial_table
GROUP BY fin.id

And these are the results




Total general 2011 2010 2009 2008 2007 ID/8/9/10/11/12 years to come
0 121 541 2545 1454 5454 3545454 CHWP01L201
80000 654534 45654 4545 545 54545 212545 CREP01L201



So if I create a normal SQL statement (function of PL/SQL returning query) it works beautifully, but as we cannot make the same Interactive report I created an apex_collection based on the above function.

Here's my problem, because the columns are dynamic can't go and create a report based on ' Select * from apex_collection ' that returns all the 50 columnswhether apex_collection they gave or not. And even if I do "Select c001, c002 c003... Of apex_collection 'headers are' c001, c002... rather than the exercises I need.

Has anyone had a similar problem? Is there a solution to this problem or should I just wait and hope that the next version of Apex has this feature (and no, Oracle buddies, no sarcasm here, only resignation after day of head breaking with no solution).

Any help will be much appreciated.

Best regards
Sophie

Hi Sophia,

Take a look on: [http://apex.oracle.com/pls/otn/f?p=27169:4]

This is a report from pivot for standard and interactive reports and explains how to create report data and generate results.

As you have seen, the complicated bit is the headers and masking the unused columns. For the version of the IR, the titles are stored in the hidden page items and the column headings are defined as & P5_HEADING1, & P5_HEADING2. etc. The columns are hidden by checking another hidden element which holds a number of columns.

You may not use directly for your own needs for IR, but if all goes well, it should give you an idea of what you could do.

Andy

Tags: Database

Similar Questions

  • Expand the column header dynamically interactive reports

    In my interactive reports one of my columns that specifically my column db_CUSTOMER_NAME can be from 3 to 50 characters. (or even more...)

    I was wondering how I can dynamically extend this td "Dynamically" column because I don't want to put a fixed length, simply because it may be 2 folders that happens on + 50 characters.

    Now I put my column width to 150 px and her scarf casual word that happens I don't want that it seems "funny."

    PandaOracle wrote:
    In my interactive reports one of my columns that specifically my column db_CUSTOMER_NAME can be from 3 to 50 characters. (or even more...)

    I was wondering how I can dynamically extend this td "Dynamically" column because I don't want to put a fixed length, simply because it may be 2 folders that happens on + 50 characters.

    Now I put my column width to 150 px and her scarf casual word that happens I don't want that it seems "funny."

    If the requirement is to prevent a return to the line in the cells of the specific column, add the following style sheet in the header HTML page:

    
    

    Ensure that db_CUSTOMER_NAME used exactly in the selector matches the attribute id of the column header.

  • How to disable dynamically interactive report filed in the page master detail

    I use APEX 4.0 & very new to APEX. I am not able to disable a class in area of detail (which is an interactive report) of a master detail Page.
    I want to turn off the field in a row based on the value of another field of recording, like set_item_instance_property of the oracle forms. Please help me.

    See {message identifier: = 10743324}

  • Interactive report case triggering a dynamic action

    Hello

    My interactive report is built, based on the following query

    SELECT ID_OPERACION, NOMBRE_CLIENTE, TOTAL_PAGAR, APEX_ITEM. CHECKBOX (1, O.ID_OPERACION, "onclick ="f_UpdateCollection (this)"', a.c001") "Seleccionar"

    OPERACIONES o, apex_collections a

    WHERE the a.c001 (+) = O.ID_OPERACION

    and a.collection_name (+) = "OPE_COLLECTION".


    I use a collection because I don't want to lose the selected controls caused by paging.


    I would like to add a dynamic action that each time check box is selected, an element (P5_TOTAL_SELECCIONADO) summarizes the column TOTAL_PAGAR of all the checkboxes that are selected and each time a checkbox is unchecked the Total_seleccionado subtracts the value of the selected item.


    How can I do?

    Hi Eva,

    Please check again your application and see if it's what you thought.

    I made a few changes. First, here you were talking about P5_... the elements in your workspace apex.oracle, the page number is 1, so I changed the P5_... elements of P1_...

    Then, you let the fire on the boxes page laod on, but you don't want t function to begin to evaluate during page loading.

    There were also a few errors in the javascript code, I suggested. The VALOR_PAGAR selector was not correct, I've changed a little bit. Also all selected text values are strings and adding javascript strings will be just concatonate them. I made string number conversion for you, also taken into account that null values (P1_TOTAL_SELECCIONADO on page loading is null) cannot be cast to number.

    The result is:

    var VALOR_PAGAR = $(this.triggeringElement).closest('tr') .find ('td [headers = "VALOR_PAGAR"]') .text)

    var TOTAL_SELECCIONADO = $v ('P1_TOTAL_SELECCIONADO')

    VALOR_PAGAR = (isNaN (parseInt (VALOR_PAGAR) = VALOR_PAGAR)? 0: VALOR_PAGAR)

    TOTAL_SELECCIONADO = (isNaN (parseInt (TOTAL_SELECCIONADO) = TOTAL_SELECCIONADO)? 0: TOTAL_SELECCIONADO)

    var total = VALOR_PAGAR + TOTAL_SELECCIONADO

    $s ('P1_TOTAL_SELECCIONADO', total)

    This is the code to add checkboxes checked, false action is the same except for total, which is:

    var total = VALOR_PAGAR - TOTAL_SELECCIONADO

    Kind regards

    Vincent

  • Call for dynamic action of an interactive report

    Hello
    I'm on APEX 4.1, 11 GR 2, Windows 7 and the latest version of Firefox.
    I have an interactive report. I want the end user to have the ability to click on a link to line level and launch a modal pop up on another page. Ideally, I would like to be able to use the Skillbuilders plug-in. I can make it work if I just go the road full page but I can't find a way to make it work like a modal pop up.
    I have tried different methods, which work, but I think that I should follow that is using a page-level dynamic action that fires when a found JQuery element selector is selected.
    The problem I have is that I can't find the proper JQuery selector syntax for the column. My report has a static ID of the IDN and my column a header of PARTS.
    The best I can manage is not to see something happen as a page refresh (if the link is on the same page). I don't see no errors in console and firebug.

    I replaced the dynamic action modal page appeal by an alert, which is not displayed, to make sure that it is not the configuration of the plug-in which is the cause of the problem.

    Someone would be kind to give me an idea of what I should be completed in the JQuery selector field of the DA and what should be the attributes of link? Because I want to redirect from page 1 to page 2, what should I put in the other fields in link?
    I've been chasing my tail with this for hours and read all the posts in this area, I could find, but I can't make it work. Any help would be much appreciated.
    Kind regards

    Danny

    That's what I did on my column link of an international registration:

    Link icon: (choose something)
    Link attributes: class = "btndetails" onclick = "return false;"

    (the onclick is vital, it prevents the default anchoring action does not happen)
    Implement the details of the target page that you want in your popup modal

    Create a dynamic action

    Event: click on
    Selection type: jQuery Selector
    jQuery Selector: .btndetails

    Advanced > scope of the event: live

    Real action:

    Modal Skillbuilders page:
    Location of the URL: attribute of the triggering element
    Attribute name: href

    Who should appear in the page without problem. The onclick is the key here, and probably why you were chasing your tail so far.

  • Dynamic action function Interactive report select value list

    I want to perform an Action when a user selects one of the 3 options in a selection list in an interactive report:

    Select APEX_ITEM. SELECT_LIST)
    p_idx = > 3,
    -p_value = > deptno,.
    p_list_values = > ' copy; Copy, delete, delete, export to PDF format. Export to PDF ',
    -p_attributes = > "style =" color: red; ' " ',
    p_show_null = > 'YES ', he said.
    p_null_value = > NULL,
    p_null_text = > "- Select -",
    -p_item_id = > ' f03_ #ROWNUM #'.
    p_item_id = > 'P6_IR_SELECT_LIST ',.
    p_item_label = > ' label for ROWNUM f03_, #
    p_show_extra = > 'YES') "Actions".
    Double;

    When you generate the dynamic Action, I chose the following values of the Advanced Wizard
    Event: select
    Selection type: DOM object
    DOM object: P6_IR_SELECT_LIST
    Condition: Equal to
    Value: 'delete '.

    Action: Run the Code JavaScript: Alert ('Here');

    Does not seem to be shooting... can anyone help?

    Thanks in advance,
    John

    The problem is the type of event.

    'Select' fires when text is selected in a text field, not when an option is selected in a list...

    Try instead "change."

  • APEX 4: Dynamic Action to manipulate a search string in the interactive report

    Hello

    I have the following problem. I have an interactive report that shows a few columns and one of them has a barcode that has been saved as a numeric value for display in the column is something like ("123456789"). All works fine so far. If anyone 123456789 they will get the right line and all is well. Unfortunately if I scan in the barcode with a barcode scanner, he enters '01234567890'. I don't have nor the ability to reprogram the scanner BC and I can't change how the data gets displayed.

    So I thought I would create a dynamic action that is triggered when the contents of the textfield object change. So, I've created a dynamic action, selected jQuery and entered .apexir_SEARCH and the Change event.
    I then chose to run JavaScript and entered as cod:

    var newsearch = document.getElementById ('apexir_SEARCH').value.replace (/ ^ [0] + / g, ");
    var inputObj = document.getElementById ("apexir_SEARCH");
    If (inputObj)
    {
    Update of the value
    inputObj.value = newsearch;
    }

    So far so good. When I load the page and enter a value from a '0', it works like a charm and it removes the zero. But if I delete again on the page and the search filter, dynamic action will do nothing. I'm really confused, as if I just made a mistake in the JavaScript code or what is the reason, that the action runs only the first time. I have to reload the page and then it will still be to manipulate the string once, but the second time, it won't.

    I'm very happy for any help you can provide!

    Thank you
    Dennis

    Hi Dennis,

    The thing that comes to mind is to check that the scope of the event of dynamic action is 'live '. If it's on (default) bind, then when a partial page refresh occurs, action will not fire the first time. Direct fires each time.

    Hope this helps

  • Hide filter interactive report dynamically after the page load

    Hello

    I try to hide the section of interactive report filters (hide/show the area with +/-sign on the top of the report) the loading of the page

    I have the reference to the thread after http://apex-at-work.blogspot.com/2011/02/hide-interactive-report-filter.html posted by Tobias Arnhold...

    According to the expert, all I have to do is post the following code the code JS "page loading" within a dynamic action...


    / * Hide filter IRR after page load * /.
    If ($('#apexir_CONTROLS_IMAGE').attr ("src") == ' / i/minus.gif ') {}
    gReport.toggle_controls ($x ('apexir_CONTROL_PANEL_CONTROL'));
    }

    I did, but apparently it does not work for me...

    I posted a sample on APEX. Oracle.com for review and comment

    Thank you

    Edited by: qwe12654 may 3, 2011 19:15

    Hello

    01. in the report Footer region put this

    
    

    * This will hide your filters, highlight conditions

    02. then Goto 'Report attributes' => 'Search Bar' => for 'Include search bar' select 'no '.
    * This will hide the full search bar (do this only if you want to hide this part)

    * If you get the answer then mark as 'Correct '.

  • Dynamic action with refreshment area interactive report

    Hello!

    I use APEX 4.02

    I have a page with 2 regions.
    Region1 is a form (of entry)
    Region.2 is an interactive report on the same table as region 1

    When you enter values in the form I'm trying dynmically similar research records in the table with the interactive report.

    I made a dynamic action on the change of form fields that must refresh the interactive report region. I can see this one fires if I add an alert to debug if it fires.
    The dynamic report is based on a query with bind variable pointing to the fields in the form, for example
    where
    Field1 =: P2_FIELD1


    It works fine on the page loading, so no action is triggered, but I see the lines in the region of report are the ones I'm looking for.
    The updating of the report area does not work, but it is never nice and/or showing the correct data after a change of form fields, if it looks like the dynamic action "refresh the region" does not work on the interactive report.

    Any ideas why it can go wrong?
    I want to solve this problem using standard dynamic actions and preferably not via PL/SQL or JS, should be possible if I believe documentation... ;)

    See you soon
    Bottom

    Published by: bklerk on 26-apr-2011 03:07

    Hello

    Check this example application
    http://Apex.Oracle.com/pls/OTN/f?p=39830:38

    You can download and check the source

    Kind regards
    Jari

  • Apex 4.0 interactive report row view dynamic action "after Refresh.

    Hello

    It seems that interactive report view row do not trigger the event "after refresh.
    I have not tested other events.

    I have taste.
    https://Apex.Oracle.com/pls/OTN/f?p=40323:76

    There is a dynamic action that show the alert by region "after updating' event.

    When you see a row, the alert is not displayed.
    Change record show no alert ether.

    Is it bug or missing feature?

    Kind regards
    Jari

    Hi Jari,

    I consider this a bug/feature missing as well. I filed bug # 10376989.

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

  • Dynamic action - Hide and show interactive report

    Hello

    in the apex community tip http://www.oracle.com/global/de/community/tipps/apex40-dynamicactions/index.html (only in German), there is an example to hide and show a report interactive by dynamic actions.

    The approach described in the article should be case for normal or interactive reports.
    But in my case it works for normal relations. I am not able to update or hide the interacitve dynamic equity report.

    Has anyone had similar experience?

    Greetings
    Michael

    Hello
    You are welcome.

    * It is considered good etiquette to the responses of reward with points (as "useful" - 5 pts - or 'correct' - 10pts). :)
    Thank you
    Logaa

  • Dynamic title for interactive report?

    I have an interactive report where I'm passing in the interactive report filters. It's great becase it allows me to reuse a single interactive report in different ways. However, a disadvantage, in that I am running is the title of the report. I would really like to be able to change the title of the report based on the filters that I. Is this possible? If the title of the report can be dynamic?

    Thank you

    Andrew Watson

    Change the interactive report region.
    In the title, enter & P1_SOME_PAGE_ITEM.
    When p1_some_page_item is a hidden... item store the title at this point and your will become dyanamic

    Kind regards
    Shijesh

  • Dynamic position in interactive report

    In standard reports, it is possible to create dynamic topics using PL/SQL.

    Does anyone know a way to do it for interactive reports?

    I have a report that must change the date items depends on the selected start date.

    Thank you

    Jon

    Hi Jon,

    It's a little different from what you expect.
    What you can do, is to refer to an element hidden for ex. In your interactive report you're & P1_ITEM. that contains your dynamic position (PLSQL code)

    Kind regards
    Dimitri
    ----------------------------------
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Interactive dynamic query reports

    Hallo!

    Please help me understand how to generate an interactive report based on the condition to the APEX 5. Basically, it must be based on the condition. Something like this:

    If (: p2 > 2) select * from table1 otherwise select * from table2.

    Thanks in advance!

    2608792 wrote:

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

    Please help me understand how to generate an interactive report based on the condition to the APEX 5. Basically, it must be based on the condition. Something like this:

    If (: p2 > 2) select * from table1 otherwise select * from table2.

    Interactive reports require a projection of stable column. If the columns in table1 and table2 are identical so it can be implemented in a simple report using SQL:

    select * from table1 where :p2 > 2
    union all
    select * from table2 where :p2 <= 2
    

    If the columns in the tables are different, then create several areas of the IR on the page (now possible in APEX 5.0) and conditionally restore using the required logic.

  • Passing ID as csv of an interactive report parameters in a function.

    Hello. I tried to add a checkbox in the first column in an interactive report and have tried to spend 'EMPNO' in the box. I tried this query.


    select apex_item.checkbox2(1,EMPNO,'CHECKED')" ",
            EMPNO,
           ENAME,
    CASE WHEN JOB='PRESIDENT' THEN
    'REMP PRES'
    WHEN JOB='MANAGER' THEN
    'REMPMANAGER'
    ELSE 'REMPOTHERS'
    END
           JOB,
           MGR,
           HIREDATE,
           SAL,
           COMM,
           DEPTNO
      from EMP
    

    Instead of boxes, I received a message on the screen in the first column as, < input type = "checkbox" name = "f01" value = "7839" CHECKED / >

    I also have a button "submit" on this page. When this button is clicked, I to call a (Javascript) function passing the EMPNO of the rows with checkbox enabled in the settings. The "EMPNO" parameter should be passed as CSV (if several check boxes are selected, I want to spend the EMPNO of all audited lines as parameters in a CSV file).


    I have reproduced the issue in oracle workspace.


    Workspace: XXKIRAN

    Username:[email protected]

    Password:kiran123

    App.No: 95253

    Page: 4


    Can someone help me on this please?

    Mencis Joe wrote:

    I also have a button "submit" on this page. When you click this button, I want to call a function (Javascript) which passes the EMPNO of lines with checkboxes checked in the settings. The 'EMPNO' parameter must be passed as CSV (if several check boxes are selected, I want to spend the EMPNO of all the lines that have been verified as parameters in a CSV file).

    Why CSV? The first thing that the function will probably do is to convert the string to an array...

    1. Add a static ID column of the box for use as a jQuery selector.

    2. place the Action defined by the dynamic ActionSubmit button.

    3. create a dynamic action:

    Event: Click

    Selection type: Button

    Button: Send

    Real Actions

    Action: Run the JavaScript Code

    Fire on Page load: NO.

    Code:

    var checkedIDs = $('td[headers="row-selector"] input:checked')
                      .map(function(){
                        return $(this).val();
                      })
                      .get()
                      .toString();
    
    // Call function passing checkedIDs as parameter
    
    alert('Checked IDs: ' + checkedIDs);
    

Maybe you are looking for