Charts based on page items

Hello,
I want to create a Pie chart based on page items. There are 3 page items that I want to use for an Pie chart. The page items are calculated in an page process PL/SQL block and they are numbers. I want all PL/SQL in that page process and from there built the Pie chart. Is this possible to use the page items for the pie chart, I can only find information to build charts with querys.
I use apex 4
Edited by: Martijn Brands on 1-sep-2010 2:46

I have used an function with three values as input and returning an pl/sql table with the three values.

Similar Messages

  • Conditional Formatting for Report Rows based on page item

    Hi,
    I have a report and a page item on a page. I would like to somehow highlight any report rows where a particular column in the report (e.g. "Customer_ID") matches the page item (e.g. P2_CUSTOMER_ID).
    Any idea how to do this?
    Thanks,
    Forrest

    You can also achieve this by jquery ( Please note - I just started learning jquery , so my way of doing it may not be a good way of doing it)
    1. Download jquery from [http://www.jquery.com]
    2. In Page Header enter
      <script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.js"></script>
       <script type="text/javascript">
       $(document).ready(function(){
          //t20data is the class for table cells in theme 20 .. change it as per you theme - right click view source and find it
             x = $('.t20data').length;
         //i=7 is the column index of customer id
        // i = i + 10 , 10 is the number of column
           for( i = 7 ; i < x ; i=i + 10)
                if($('.t20data').eq( i ).html() == $x('P2_CUSTOMER_ID').value)
                    // i-7 is the first cell of row and i+2 is the last cell of row 
                    for( c = i - 7 ; c <= i + 2 ; c++)
                         $('.t20data').eq( c ).css("background","red");  
    </script>[ E X A M P L E | http://apex.oracle.com/pls/otn/f?p=62171:1]
    Regards,
    Shijesh

  • Dynamic where clause based on Page Items

    I need an example of how to build a where clause with values from page items.
    I want to do something like the following but do not know the syntax:
    sql_string := ' where lab.ceventno is not null and lab.cts_no_show is null ';
    if :P1_RECID is not null then
    sql_string := sql_string || ' and lab.recid = ' || :P1_RECID;
    end if;
    if :P1_CAS_NO is not null then
    if :P1_CAS_TYPE = 1 then
    sql_string := ' and upper(lab.cas_no) = ' || :P1_CAS_NO;
    elsif :P1_CAS_TYPE = 2 then
    sql_string := ' and lab.ceventno in (Select ceventno from msds_ing where cas_no = ' || :P1_CAS_NO;
    end if;
    end if;
    :P2_WHERE := sql_string;
    I put this in a process that I want to pass to Page 2 when search button is pushed. I'm not sure what I'm doing wrong, but this doesn't seem to work.
    When I print out :P2_WHERE, I only get the first line
    'where lab.ceventno is not null and lab.cts_no_show is null '
    Any help would be much appreciaed
    Thanks
    Pam

    Pam - We need more details about exactly what you are doing, e.g., how are you going to dynamically execute that SQL, what items are on page 1 that will be submitted (all search criteria), what happens on page 2, etc.
    But here are a few points:
    1. when building a query for dynamic execution, put the bind variables like ":P1_RECID" into the generated SQL, e.g., do this:
      sql_string := 'select ename from emp where empno = :P1_EMPNO';
    not
       sql_string:= 'select ename from emp where empno ='||:P1_EMPNO;They may appear to give you the same results but the first introduces non-reusable SQL into the shared pool (this is bad).
    2. When code runs that references user-entered item values on the current page, like "if :P1_CAS_NO is not null", you have to make sure those items have been submitted (as with a page-submitting button) before you reference them. So if the user enters search criteria into form fields, then submits the page, then you reference those items in the SQL-building process, you'll be okay.
    3. Watch for errors like your line: "sql_string := ' and upper(lab.cas_no) = ' || :P1_CAS_NO;" which you may have intended to be "sql_string := sql_string||' and upper(lab.cas_no) = ' || :P1_CAS_NO;".
    Scott

  • How to validate a item in page based on previous item in same page

    Hi,
    I need to know how we can hide items based on page item
    ie i have 5  item in same page like weighed(radio button) yes / no if user select yes na it ll automatically enable remaining fields like weight,packing charges, courier charges and net total
    and based on packing charges,courier charges, other charges the net charge ll be auto calculated.....
    please any one reply asap..
    Regards,
    Priya

    i have  to align the items in single page(form)....
    ie i have  to arrange the regions in sequential manner
    for example i have x , y , z , a  , b , c , d ,l m  regions
    y  and z in horizontal  in first row
    b  and c  in vertical  in first column
    x and a  in  vertical in second column
    d in vertical in third column
    l  and m in horizontal  in last  row
    y -----------------------  z
    b    x
    c    a    d
    l------------------------m
    to achieve this wat i have to do

  • Button condition on page item and Validation error Conflict

    Hi,
    I have a select list page item and a button on page whose condition is based on the select list page item value(eg, If (:P2_item1='val1'){return true;}) with condition type=PL/SQL function returning boolean. This buttons submits the page.
    It' coming fine in normal case. However, if I select some value val2 from the list and then click the button, and if there are any validation errors (like mandatory check or email check fail etc), then the button disappears because it evaluates the button condition based on the changed value(val2), but the page has not yet been submitted because of validation errors.
    I think this can be solved if I create the button condition based upon database column value instead of page item as db col value won't change until the page is submitted.
    This look like very basic use-case and I would like to know if there is any better solution to this problem.
    Note: I am using Apex 4.2.1

    I don't want to show/hide the button on the change of the page item lov value, so i am not using Dynamic action.
    What i was is to make button visible based on a condition(which is based on page item), for which we have condition attribute of a button available.
    This is a very common thing where a user chooses the button condition as Value of item/column in expression 1 is null/expr2. But what if the user changes the page item value but it doesn't get submit due to validation error. In that case, the button condition fails.
    So, i guess i have to use column name in expression 1, can u tell how to do that?
    Expression 1 = IF (:P2_STATUS='val1') then return true;
    How to change the above to use db column 'status' instead? Any direct way(like #Status#) or I have to query db to get it using select.
    Any alternative approach?

  • Report row highlight based on a page item

    Is there a way to highlight a report row based on the value of a page item?
    In my case I have a report where the application user requests data in a detail report using a column link in the master report. This loads an id number from my report into a page item (say :P8_ID for example). If this item is null, I want the report rows to all render normally (nothing is selected or the detail report has been closed). If there is an id in that field then I want the row containing the information about that item to highlight (its column link has been clicked selected it to bring up a detail report).
    At first glance, this looks similar to Vikas solution (Change the Report row color when clicked but I am trying to make the connection between what has already been done and where I need to be.

    After looking back, I discovered my value was being set after the report rendered. When I re-organized my calculations and the rest, it worked.

  • IR Report based off of page item value

    Hey all,
    I want to create an IRR region and have the report update based off of a a page item.
    The page item will be a drop down of the tables I want to show, so something like:
    Select * from '||v('P1_TABLES')
    This will work with the normal report but not with the IRR. Is the syntax incorrect?
    Help is appreciated!
    Edited by: Ben C on Feb 23, 2012 6:42 AM

    Zooid,
    but always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always always
    use bind variables !!!!
    Regards,
    Richard
    blog: http://blog.warp11.nl
    twitter: @rhjmartens
    If this question is answered, please mark the thread as closed and assign points where earned..

  • How to populate another page item based on cascading select lists?

    Oracle 10gXE
    APEX 3.2
    I've created cascading select lists based on the examples (using Javascript and AJAX) that i've seen on this forum. Thanks for help on that!
    Now that I have these LOV's being populated without needing to submit the page, how do I take the value that is presently in each LOV and concatenate them together to populate another page item? I'm trying to build the URL string that will execute an Oracle Report once the user clicks a button.
    Previously, when I had multiple Select Lists with a submit, the URL was being put together using an After Submit Computation that would set the value for an item (P26_REPORT_URL) on the page. Notice that a report parameter (i.e. parameter name and Select List value) is only included if the user has provided a value. The page item that holds these values is then referenced by a button for URL redirect. The URL Target for the button currently is: javascript:popupURL('&P26_REPORT_URL.'), but will not work at the moment because P26_REPORT_URL page item is not changing based on what is selected in the LOVs. Since I'm not submitting anything (do I need to?), how do I put together the values needed?
    Computation for P26_REPORT_URL:
    DECLARE
    l_param VARCHAR2(2000);
    BEGIN
    l_param := '&REPORTS_URL.&report=&P26_RPT_VIEW..rdf&desformat=&P26_DESFORMAT.&destype=cache';
    IF REPLACE(:P26_OLO_CODE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_olo_code=&P26_OLO_CODE.';
    END IF;
    IF REPLACE(:P26_BEG_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_start_dt=&P26_BEG_DATE.';
    END IF;
    IF REPLACE(:P26_END_DATE,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_end_dt=&P26_END_DATE.';
    END IF;
    IF REPLACE(:P26_ORG_CODE_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_org_code=&P26_ORG_CODE_2.';
    END IF;
    IF REPLACE(:P26_FLAIR_ORG_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_flair_org_code=&P26_FLAIR_ORG_2.';
    END IF;
    IF REPLACE(:P26_BUDGET_ENTITY_2,'%'||'null%',NULL) IS NOT NULL THEN
    l_param := l_param||'&p_agy_code=&P26_BUDGET_ENTITY_2.';
    END IF;
    RETURN l_param;
    END;

    Andy,
    This is a great suggestion! After I posted, I started looking at a Javascript solution and figured it's probably what I had to do.
    However, now the cascading select list no longer working for some reason after I added the function to concatenate the item values. When I remove the showReport() function the select list works again.
    Here is what I have in the HTML Header portion of the page:
    <script language="JavaScript" type="text/javascript">
    function popupURL (url) {
      w = open(url,"winLov","resizable=1,width=800,height=600");
      if (w.opener == null)
      w.opener = self;
      w.focus();
    function showReport()
      var l_param = '&REPORTS_URL.&report=' + $v('P26_RPT_VIEW') + '.rdf&desformat=' + $v('P26_DESFORMAT') + '&destype=cache';
      if ($v('P26_OLO_CODE' != '')
       l_param += '&p_olo_code=' + $v('P26_OLO_CODE');
      if ($v('P26_ORG_CODE_3' != '')
       l_param += '&p_org_code=' + $v('P26_ORG_CODE_3');
      popupURL(l_param);
      function get_AJAX_SELECT_XML(pThis,pSelect){  
         var l_Return = null; 
         var l_Select = $x(pSelect); 
         var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORG_SELECT_LIST',0); 
         get.add('TEMPORARY_ITEM',pThis.value); 
         gReturn = get.get('XML'); 
         if(gReturn && l_Select){ 
             var l_Count = gReturn.getElementsByTagName("option").length; 
             l_Select.length = 0;
             for(var i=0;i<l_Count;i++){ 
                 var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) { 
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{ 
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>

  • Conditionally set page item based on value of another item

    Hello,
    I have a form that is used to create/apply changes to records. There is an application item (APP_ITEM_PROFILE)
    that is set on login which contains a value for the user's Profile ID. This Profile ID is used through out the
    application for authorizations (conditionally present tabs, etc).
    I've set a page item on the form equal to APP_ITEM_PROFILE so that the record is stamped
    with that user's profile ID when they create a record. Users with different Profile IDs may later make changes to
    the record but I want to keep the original Profile_ID on the record.
    I am trying to populate the Profile ID conditionally in the form based on the existence of a
    record ID. If there is no ID (a new record is being entered), then I want the
    Profile ID to be that of the current user (APP_ITEM_PROFILE). If there is an ID (modification is
    being made to an existing record), then I want the keep the Profile ID that was originally saved
    with the record in MyTable.
    I have this as the source for :P11_PROFILE_ID. The type is PL/SQL Expression or Function, Always, replacing... but it
    is not working (page not found when page is run):
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into :P11_PROFILE_ID
    from MyTable
    where ID = :P11_ID;
    elsif :P11_ID is null
    then select nv(':APP_ITEM_PROFILE') into :P11_PROFILE_ID from dual;
    end if;
    end;
    Item Descriptions:
    ID is the record ID.
    :P11_ID is the page item of the record ID (Display as Text, saves state).
    PROFILE_ID is the user's Profile ID.
    :P11_PROFILE_ID     is the page item of the user's Profile ID.
    :APP_ITEM_PROFILE is the user's Profile ID that is set on login.
    Any help is greatly appreciated.
    Thanks,
    Matt
    Update:
    I found one of Scott's answers:
    Using IF Else to determine the value of a Item
    and modified the above code to:
    declare l_ret number;
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into l_ret
    from MyTable
    where ID = :P11_ID;
    else select :APP_ITEM_PROFILE' into l_ret from dual;
    end if;
    return l_ret;
    end;
    It seems to be setting the Profile ID correctly when the ID is not null, but not when a new record is being created. In the latter case, there is no value.
    Edited by: mterlesky on May 11, 2009 11:02 PM
    Edited by: mterlesky on May 11, 2009 11:52 PM
    Edited by: mterlesky on May 11, 2009 11:53 PM

    Thanks. That is putting the value into the page item and session state but that value is not being saved when the record is created. I'm not sure why - here is part of the debug (the "Billing" table is the "MyTable" table in the previous posting). Any thoughts?
    On form, before submit:
    0.06: Saving g_arg_names=P11_PROFILE_ID and g_arg_values=112
    0.06: ...Session State: Saved Item "P11_PROFILE_ID" New Value="112"
    After Submit
    0.06: ...Session State: Save "P11_PROFILE_ID" - saving same value: "112"
    (validations not shown)
    0.10: Processing point: AFTER_SUBMIT
    0.10: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select BILLING_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P11_ID := get_pk; end;
    0.10: ...Session State: Save Item "P11_ID" newValue="452" "escape_on_input="Y"
    0.10: ...Do not run process "Get PK for CREATEAGAIN", process point=AFTER_SUBMIT, condition type=, when button pressed=CREATEAGAIN
    0.10: ...Process "Process Row of BILLING": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:BILLING:P11_ID:ID|IUD
    0.10: ...Process "Update TOTAL_HOURS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_HOURS = ((NVL(CD_90801_UNITS,0)*1.5)+ (NVL(CD_90804_UNITS_B,0)*.5)+ NVL(CD_90806_UNITS,0)+ (NVL(CD_90808_UNITS_B,0)*1.5)+ NVL(CD_90812_UNITS,0)+ (NVL(CD_90814_UNITS_B,0)*1.5)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NV
    0.11: ...Process "Update TOTAL_UNITS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_UNITS = (NVL(CD_90801_UNITS,0)+ NVL(CD_90804_UNITS_B,0)+ NVL(CD_90806_UNITS,0)+ NVL(CD_90808_UNITS_B,0)+ NVL(CD_90812_UNITS,0)+ NVL(CD_90814_UNITS_B,0)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NVL(CD_90853_UNITS,0)+ NV
    0.11: ...Process "G_TRANS_COUNT_ADD": PLSQL (AFTER_SUBMIT) begin :G_TRANS_COUNT := :G_TRANS_COUNT +1; end;
    0.11: ...Session State: Saved Item "G_TRANS_COUNT" New Value="1"
    0.11: ...Process "Email_Notification": PLSQL (AFTER_SUBMIT) declare l_body_html varchar2(4000); begin l_body_html := '<p>Billing ID '||:P11_ID||' was entered by '||:P11_PROV_NAME||'.'|| ' More transactions may have been entered by the provider after this one.'||'</p> <p><a
    Edited by: mterlesky on May 12, 2009 9:21 AM

  • Creating Chart based on a Table in same Pages Document

    Hi
    1. how can  create a chart in a pages document based on an existing table in same document without the need to create a chart then paste the data of table into it ?
    2. if i have a column vales and i copied it how to paste it in the column headers of the editing data window of a chart, i tried and all copied values will be pasted in the cell of one header and i cant select all column headers to paste the values in them ?

    You can't. Charts in Pages rely on their own data table, or can pick up data from a Numbers table.
    You can include column headers and data cells in a single paste, as I did here:
    Select all six cells of the table
    Copy
    insert the chart (or Select the existing chart and click Edit Data in the Chart inspector).
    In the chart's data table (below), click on the first header cell ('B1')
    (Both the header cell and the data cell(s) in that column will be highlighted.
    Paste.
    (Results should be as shown below.)
    Labels (in the left column) can't be included in this paste as the top left cell ('A1') apparently can't be selected. Haven't checked this fully as yet, and no time to do so at the moment.
    Regards,
    Barry

  • Charting a page item

    I´d like to use the line chart function to chart a previously selected page item;
    I´d like to do something like this:
    select null l,
    TIME,
    VAR
    from(select
    to_char(timestamp, 'HH24:MI:SS') TIME, P100_PAGEITEM VAR
    from TABLE
    where VARIABLE2 = x
    order by TIME)
    where the P100_PAGEITEM is pulled from a selector box on the page.
    Sergio, if you´re reading this, it´d be like a one variable ad hoc chart function...
    Any ideas on how to do this?

    This basically means that there is an object that has its top left corner at x: 34 y: 488 which is too large to be rasterized, it could be due to any large object that is extreme wide or tall.
    Try to check page content and then resize it to verify the behavior. Please let me know how it goes.
    Thanks,
    Sanjit

  • Display page items based on Authorization Scheme...

    I have a report form that shows all my columns, but I have two columns that I only want "Admin" and "Edit" from my authorization scheme to be able to edit; but I would like for "User" to view.
    Currently I have "authorization" enabled for the two items, and set for "Edit". This works, except the "User" logins cannot view the items.
    I thought of two possibilities, both I think I'd need help on though!:
    1. Create a duplicate page item for these two items. One would show as "Text" only (cannot edit). The other would be "Text Field". The "Text Field" column would only be
    accessible by "Edit" or "Admin".
    The problem, though, is now "Edit" or "Admin" users will see both columns
    2. Set up something in "Conditions" that would show as "text" for "User", and as "Text Field" for "Admin" or "Edit"?
    I would have no clue how to do this...
    Any thoughts?
    Kevin L.

    Kevin
    You can create two items and in the Authorization Scheme you can set one as Users and second as Edit. Also You can do something using small JS. Create a variable P_USR_TYPE to hold the value of User group lets say 1 for Users and 2 for Edit. Then on the HTML header or footer of the region you can add a javascript call
    function UsrCustomization()
         if ( P_USR_TYPE == 1 )
              // mark the item as readonly
              // document.getElementById('P1_FIELD_QUESTION').disabled = true;
              document.getElementById('P1_FIELD_QUESTION').readOnly="readonly"
    UsrCustomization();Thanks,
    Manish

  • JQuery "setting all items to READONLY based on a page item" not working

    I am attempting to use jQuery to set all input fields to "readonly" if the question is in "locked" status (i.e., if P2_QUESTION_LOCKED page item is set to yes ("Y")). The following is the code that I placed in the page attributes (in the javascript section):
    if ($x('P2_QUESTION_LOCKED') )
       if ($x('P2_QUESTION_LOCKED') == 'Y')
           $(document).ready(
           function() {    $('input').attr('readonly','readonly'); });
       }It is not working. All input fields are available for input. I used Firefox 1.6 and Firebug and I have no errors. What am I missing?
    An example is set up in APEX.ORACLE.COM:
    Workspace: RGWORK
    Application: Financial Disclosure (Application 45806)
    User Name: TESTER
    Password: test123
    Run the application, and click on 'Update Current Year's' from the list.
    Robert
    http://apexjscss.blogspot.com
    PLEASE IGNORE THIS THREAD. A THREAD IS ALREADY OPEN. HAD A HICCUP WITH THE INTERNET.
    Robert
    Edited by: sect55 on Dec 12, 2010 3:11 PM

    Hi Robert,
    I have changed your code to
    if ($x('P2_QUESTION_LOCKED') )
       if ($v('P2_QUESTION_LOCKED') === 'Y')
            $('input').attr('readonly','readonly');
       }Especially the
    $x('P2_QUESTION_LOCKED') == 'Y'to
    $v('P2_QUESTION_LOCKED') === 'Y'I have also moved your code into "Execute when Page Loads".
    Couldn't try the code because I was not able to login, but I think the code should work.
    Regards
    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

  • Display as Text page items - How to change color based on Value

    Hi,
    I have a bunch of page items that I would like to display in red if they contain a minus "-" sign. My guess is that this can be done with a template. Right now they are using the Optional Label with Help template. How might I elegantly specify to display a red font if the text contains a minus sign?
    I have done this before with report regions which include conditions and I just tagged a condition to a column template and I am looking to do something similar.
    Thanks!

    You haven't had a response... I was wondering if you could answer the question I posed of where are the "Display As" templates?
    It seems that there is nothing on the forum or WEB about them. They must be in a CSS sheet somewhere, but I don't even have access to those folders at work.
    I exported a "theme" and started to look through the sql code that created the CSS file (at least that is what I think it does) but it is about 170k and it is slow reading... I have tried searching on several key words but no luck yet.
    I appreciate any insights you have. It seems to me that the display as templates would provide some real cool features...
    turn negative numbers red
    gray out non-updateable fields
    The look and feel that would meet a design standard for a specific company...
    Best of luck,
    Sam

  • Computed page item no longer working after upgrade to 1.6

    Hi team,
    I noticed that the pages where I was using conditional computations based on sql queries for setting the value of items are no longer working as before.
    If I run the page in debug mode however I see that the computation is actually performed and the correct value is retrieved indeed. The value is also present in the session window.
    This values are used inside chart region titles, but for some reason they do not show up.
    Are you aware of any known problems?
    In case you want to check, the application is 21670, page item is P64_CATEGORY_NAME (page 64, of course) and it is recalled inside the chart region's title.
    Thanks,
    Flavio

    Flavio,
    I think it's working now. The source type of the item was 'Always..' and the source was 'Always null'. Changed to 'Only..' and 'Static Assignment'. The computations are working right, as you said. It was just that the item's current value (in the memory arrays) was null and that's what was used in the &ITEM. substitution.
    Scott

Maybe you are looking for