Creating Selection List Dynamically or Through Code
Has anyone created Selection Lists for Excel or Analyzer Dynamically Through Code? We have lists that could change quite often and would like to automate the process.
Different methods for different situations. If you are just concerned about capturing newly added descendants/children of a dimension, it may be best to always begin the query at the appropriate parent level, then zooming/drilling to list all children/descendants at the time the query is run. Assigning attributes is another way to achieve this, assuming all the members which you wish to capture are similar in nature (eg. flavor, size, product category, etc.). After creating the attribute dimensions and assigning them to base dimensions, simply adding the attribute to the query dynamically filter the values returned. You can also drill/zoom on the attribute dimension in the query to view detail lists of the individual members which match.
Similar Messages
-
Creating Select List with multiple columns
I want to create a select list with multiple columns. I followed the demo application model described in the by Denes Kubicek (Currently my reference for APEX !!)
The code is as follows:
CREATE OR REPLACE FUNCTION getcrops(p_cropid IN NUMBER)
RETURN VARCHAR2
IS
v_cropid VARCHAR2 (400);
v_fcode VARCHAR2 (400);
v_product VARCHAR2 (400);
v_var VARCHAR2 (400);
v_fname VARCHAR2 (400);
v_acres VARCHAR2 (400);
v_style_start VARCHAR2 (400);
v_style_end VARCHAR2 (400);
v_return VARCHAR2 (400);
BEGIN
FOR c IN (select "CROP"."CROPID" as "CROP ID",
"CROP"."FIELDCODE" as "FIELD CODE",
"CARROTPRODUCTLIST"."CARROTPRODUCTNAME" as "PRODUCT",
"VARIETYLIST"."VARIETYNAME" as "VARIETY",
"FIELD"."FIELDNAME" as "FIELD NAME",
"CROP"."SIZEINACRES" as "ACRES"
from "FIELD" "FIELD",
"CARROTPRODUCTLIST" "CARROTPRODUCTLIST",
"VARIETYLIST" "VARIETYLIST",
"CROP" "CROP"
where "CROP"."CARROTPRODUCTTYPE"="CARROTPRODUCTLIST"."CARROTPRODUCTID"
and "CROP"."VARIETYID"="VARIETYLIST"."VARIETYLISTID"
and "CROP"."FIELDID"="FIELD"."FIELDID")
LOOP
v_cropid := TO_CHAR (c.'CROP ID', 'FML999G999G999G999G990');
v_fcode := c.'FIELD CODE';
v_product := c.'PRODUCT';
v_var := c.'VARIETY';
v_fname :=c.'FIELD NAME';
v_acres :=c.'ACRES';
FOR i IN 1 .. 12 - LENGTH (c."CROP ID")
LOOP
v_cropid := v_cropid || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD CODE')
LOOP
v_fcode := v_fcode || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'PRODUCT')
LOOP
v_product := v_product || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'VARIETY')
LOOP
v_var := v_var || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD NAME')
LOOP
v_fname := v_fname || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'ACRES')
LOOP
v_acres := v_acres || ' ';
END LOOP;
v_return := v_cropid || v_fcode || v_product || v_var || v_fname || v_acres;
END LOOP;
RETURN v_return;
END;
I created this anonymous Pl/SQL function at a application level ..Then I followed up to create a select list with a function inside. However I could not create select list with the command suggested in the demo which is
select getcrops(cropid) d, cropid r from crop;
APEX (2.1) returns a error message. What am I missing ? Should the function be called from somewhere else after creating a regular select list..? Where the functions (Pl/SQL) should be ideally stored for application level access..? and for across application level access ? How can I check the function works good. Help is appreciated.Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
Filter report on multiple select lists dynamically
Hello
Can somebody tell me how to filter/refresh a interactive report based on multiple select lists?
The select lists are created with apex_item.select_list_from_query, because I need to create them dynamically.do not post duplicate questions/posts when you already have {message:id=10453848}
It doesn't make any sense -
How to get the text boxes and select lists dynamically?
Hi,
I have a requirement such that I need to create the text boxes and select lists depending on the user input at the run time. It means that if the user requires four text boxes/select lists then I need to have 4 such thing. If the user need 6 then I need to have 6.
The design may be such that initially only one text box/select list will be available when the page launches. Then as ad when the user asks for more those will be available to the user accordingly.
regards,
Dipankar.You can use Ajax to call textboxes and select list based on what user enters.
Otherwise make those items conditional and based on what user enters you can display textbox or select list.
You can call Single Textbox and Select List using Ajax for any number of conditions.
Regards
Chandra -
Help:create tree node dynamically from java code...
hi there...can anyone give me solution how to create or add tree node dynamically from java code???
currently i am using tree node to handle my menu...i try to create tree and add treenode dynamically from .java page, but it failed...can anyone give solution how to create tree ui from java code, so i can create a dynamic menu...thanz before...Hi:
Just put the statements you would normally put on a sqlplus command line in jdbc statements and execute them?
http://www-db.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html#0.1_executeUpdate
MJG -
How to make columns in the select list dynamic
Hi
I need to make columns in the select query dynamic.I have three tables.Table 1 contains master information lets say name of group(A group consists of members of various skill sets) and its period(A group is of specific period lets say for 18 months).Table 2 contains different skill sets corresponding to a group i.e there is one to many relationship between table 1 and table 2.Table 3 contains months information of skill sets.For example if skill set 1 is required for 5 months then there will be 5 rows(for each month) in table 3 corresponding to a skill set i.e there is again one to many relationship between table 2 and table 3.Tabale 3 will also contain man month value for perticular month.I need to show all the periods of a group and its sum of man month value for all skill sets.
If group1 is of 6 months (starts nov2006 and ends Apr2007) and has 5 skill sets then there will be one entry in table 1 and 5 entry in table 2(For skill set).For each entry in table 2 there will be 6 entry in table 3(for each month).I need to write a query which would display
Group name nov2006 dec2006 jan2007 feb2007 mar2007 apr2007
Gr1 10 15 21 17 18 22--These are sum of man month of all skill set for a particular groupIf Gr 2 is of 9 months then it would disply all the information in respective months.i.e for group 2 nine months information and group 1 six months information
Pls help
Thanks in advance
SasHi,
From your requirement, we understand that you want to make Rows in table 3 as Columns.
Please search pivot in this Forum.
Regards
K.Rajkumar -
How to create Array list dynamically ???
Hi
when new session starts,dynamically it has to create arraylist.
How to do this???
Help regrading this,plzzzzz...
Cheers,
ap1_2I am not sure in which context you are asking this question
if (session == null) {
//create session here
ArrayList sessionList = new ArrayList() ;
}The above code snippet is merely a pseudo code. -
Creating select-options dynamically
Hello Gurus,
I have following program with me.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = itab_display
IMPORTING
ep_table = d_ref.
ASSIGN d_ref->* TO <F_FS>.
SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <F_FS>.
I want to select from table dynamically. i.e.
I want my select query as :
*SELECT * FROM (table) INTO CORRESPONDING FIELDS OF TABLE <F_FS> where field1 = ' x' and field2 = 'y' etc ....*
" field1 , field2 " ....i should be able to give using select-options.
Please tell me is it possible ?
Thanks.Hi,
Check the Following code
DATA tabname(10).
DATA: BEGIN OF wa,
id TYPE scustom-id,
name TYPE scustom-name,
END OF wa.
tabname = 'SCUSTOM'.
SELECT id name INTO CORRESPONDING FIELDS OF wa FROM (tabname).
WRITE: / wa-id, wa-name.
ENDSELECT.
Cheers,
Kothand -
To create selection screen dynamically
Hi All,
I need to create dynamic selection screens based on the table for which report will run.
Can anyone help me on this.
thanksHello Palak,
The best you can get on Dynamic Selection Screen: [/people/horst.keller/blog/2009/09/03/abap-geek-13--interactive-dynamic-where-clauses|/people/horst.keller/blog/2009/09/03/abap-geek-13--interactive-dynamic-where-clauses]
Straight from the "Guru"
Enjoy !!
Suhas -
Dynamic list... select list with submit
Hi,
I am trying to create a dynamic list and based on the selection I want to pass the parameters… Here is what I’ve done so far
Step 1… created a list of values (through shared components) using a query
Step 2… created an item… used option to select list with submit…
Here is the challenge: How to update my P1_Value based on the value from Select list…
Thanks in advanceI've created a page process by following these steps
Create Page Process:
Category of the process: Session State
Session State process type: Set Preference to value of Item (PreferenceName:ITEM)
Point: On Submit after computation and validation
Preference Item: P1_Value
Getting an error message:
Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306: wrong number or types of arguments in call to 'NVL' ORA-06550: line 1, column 7: PL/SQL: Statement ignored -
Populate multi select list in on demand application process
Hi all,
To populate a multi select list we use this code:
DECLARE
l_counter number;
l_o_name varchar2(2000);
l_val varchar2(100);
BEGIN
l_val := wwv_flow.g_x01;
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<select>');
FOR rec IN (
SELECT DISTINCT DECODE(districtscode,NULL,'- Onbekend -',districtscode) as "NAME"
, DECODE(districtscode,NULL,'-2',districtscode)as "ID"
FROM table
WHERE (UPPER(dienstcode) =(l_val)
or l_val = '-1')
and objectsubcategorie_id in (select objectsubcategorie_id from table where ind_actief = 'J')
and ind_uitgesloten is null
UNION
SELECT '- Alle districten -', '-1'
FROM DUAL
ORDER BY 1
LOOP
htp.prn('<option value="' || rec.ID || '">' || rec.NAME
|| '</option>');
END LOOP;
htp.prn('</select>');
END;
However: L_val is determined by a multiselect list. So, L_id can be: 'A:B:C'. I can convert the value of l_id to 'A','B','C' (with eg replace function). However in a where clause one cannot say: WHERE UPPER(dienstcode) in l_val. So I created a refcursor which I put in a pl/qsl table. Then I looped through the pl/sql table.
Somehow this did not have the same results. Eventhough the refcursor gave back the same data which I tested by logging the values of the pl/sql table just before the htp.prn command, the htp.prn did not return the values.
Does anyone know why this happens? Is there a difference between the for loop in this code and looping through a self defined pl/sql table?
Thanks in advance
MauricePlease, anybody could help me with this?
Thank you! -
LOV an SQL : how to configure a select list to get all records
Hello,
I am using Oracle 10g with APEX 2.0.
Here is my question:
I have a report and I am using 3 text fields and a select list to search through a join of two tables. The select list is composed of a "list of values" and the parameter, which is used in the SQL-sentence, has a numeric value.
Result table after the join operation looks like this:
Field1 Field2 Field3 Field4 (By assuming the field3 is the one which used in the select list.)
21a this 1000 bn
21a that 1001 vb
33c thus 1012 ct
What I want to do is to set another parameter-value pair in the select list to let user choose the "ALL" of the mentioned items in the select list so that the search will return all the records without having taken this select list-field into consideration.
Is it possible to do it with LOV and SQL? Do I need any other functions? or configurations?
Thanks in advance,
SedefHi user630478!
I always use a select list with submit and the option to get a NULL-Value for such things. To solve your problem do the following things:
1.) Create two named LOVs. One as you already did and another one for all values.
2.) Your select list with submit should be configured to show a NULL-Value e. g. it shows ALL with the value 0.
3.) Create two conditional branches that work together with your select list. One that show the normal results if a user has clicked on a normal value and the second should act only if a user has clicked on ALL.
4.) Write a process that switches the LOVs in your select list from one to the other. This process should only be fired if the second conditional branch has been actived.
Maybe if I understood right that's what you want to know.
yours sincerely -
Apex 3.2 group select list
Hi,
I just want share this if you are still in older version of Apex and you use jQuery.
I did made "plugin" for grouped select list
See sample here
http://actionet.homelinux.net/htmldb/f?p=100:86
Plugin source
;(function(){
jQuery.fn.htmldbLovOptGrp=function(o){
var t=jQuery(this);
o=jQuery.extend({
sessionValue:t.val(),
nullShow:false,
nullValue:'%null%',
nullDisplay:'%',
lovProcess:undefined,
lovGrpLabel:'GRP',
lovDisValue:'DIS',
lovRetValue:'RET',
loadingTxt:'Loading ...',
loadingCss:{'width':'80px'}
},o);
return lCreSelect(t,o);
jQuery.htmldbAjax=jQuery.fn.htmldbAjax=function(opt){
jQuery.ajaxSetup({
url:'wwv_flow.show',
dataType:'HTML',
traditional:true,
cache:false,
type:'POST',
data:{
p_flow_id:jQuery('#pFlowId').val(),
p_flow_step_id:jQuery('#pFlowStepId').val(),
p_instance:jQuery('#pInstance').val()
return jQuery.ajax(opt);
jQuery.htmldbJSON=jQuery.fn.htmldbJSON=function(opt,callfn){
return jQuery.htmldbAjax({dataType:'json',data:opt,success:callfn});
function lCreSelect(t,o,j){
t.empty().hide().parent().append(jQuery('<div/>').html(o.loadingTxt).addClass('ui-autocomplete-loading').css(o.loadingCss));
jQuery.htmldbJSON(jQuery.extend(j,{p_request:'APPLICATION_PROCESS='+o.lovProcess}),function(jd){
if(o.nullShow){lAppendOpt(t,null,o.nullDisplay,o.nullValue);}
jQuery.each(jd.row,function(i,d){lAppendOpt(t,d[o.lovGrpLabel],d[o.lovDisValue],d[o.lovRetValue]);});
t.val(o.sessionValue).trigger('change').show().parent().find('div.ui-autocomplete-loading').remove();
return t;
function lAppendOpt(t,l,d,r){
var o=lCreateOpt(d,r);
if(l){
var g=lGetOptGrp(t,l);
if(g){g.append(o);}
else{t.append(lCreOptGrp(l).append(o));}
}else{t.append(o);}return true;
function lExists(p){return(p.length==1);}
function lCreateOpt(d,r){return jQuery('<option/>').val(r).html(d);}
function lCreOptGrp(l){return jQuery('<optgroup/>').attr({'label':l});}
function lGetOptGrp(t,l){var g=t.find('optgroup[label="'+l+'"]');if(lExists(g)){return g;}else{return false;}}
})();Copy code and save it to file e.g called jquery.htmldbQuery.js and upload it to workspace Static Files.
Create new page and blank HTML region.
Create select list with LOV query
SELECT null d, null r FROM dualCreate On Demand application process called GET_GRP_LOV like
DECLARE
l_sql VARCHAR2(32700);
BEGIN
l_sql :='
SELECT mgr AS grp,
ename AS dis,
empno AS ret
FROM emp
APEX_UTIL.JSON_FROM_SQL(l_sql);
END;Place to page HTML header
<script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.htmldbQuery.js"></script>
<script type="text/javascript">
$(function(){
$('#Px_MY_SELECT').htmldbLovOptGrp({lovProcess:'GET_GRP_LOV'});
</script>Where Px_MY_SELECT is your select list name.
As I did say this need you also load jQuery. Apex 4 have jQuery , but if you are on later version see e.g. this blog post
http://www.oracleapplicationexpress.com/tutorials/66
I hope this helps someone
Br,Jari
Edited by: jarola on Aug 17, 2010 8:44 PM
Same thing seems to be work also with Apex 4.0
http://apex.oracle.com/pls/otn/f?p=40323:50
But if I have understand correctly Apex 4.0 have some build in or better thing to get same result
Edited by: jarola on Aug 17, 2010 10:54 PM
copy&paste mistake corrected
Edited by: jarola on Aug 18, 2010 12:57 AM
I hope editing post all the time is ok =).
I have not test this on any other browser than Fire Fox, so all comments are welcome.
Also I have try create similar plugin for cascading lov. Sample here
http://actionet.homelinux.net/htmldb/f?p=100:85
Maybe there is this kind plugins already for Apex 3.x, I have not just seen.
Also I'm beginner with jQuery so all help and comments is needed
Edited by: jarola on Aug 18, 2010 2:01 AM
mistake in guide corrected.Hi Matt,
which version of APEX are you currently on?
With ApexLib Framework you can have cascading select lists in normal forms, but not in a Report or Tabular Form. Also refreshing a Report when changing a select list doesn't work out of the box. You would need to add some javascript. But i think this isn't what you wanted.
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at -
Cascade select list tack few second to execute application process
Hi,
i have created some application proces fro cascading select list.
BUt when i select some value from select list then list is drpo down after click on slect value it show me drop down list value for few second .
i want when i click on selectted value then immediate relect this cascade list.
How can i resolve it.
ThanksI am trying to guess from what I understood from your question.So correct me if I am wrong.You have set up cascading select list using ondemand process (onchange call process,retrun XML/JSON , parse the reyurn data and create/append option nodes to the child shortlist ) . The problem is that the child select list has the drop down available for a few second until the ajax HTTP request finishes completion.
Now you don't want any drop own to be available as soon as you select something.
If this is the case, add a line of code that disables the child select list as the first line of the called SJ function and enable it in the last line of the function
onchange="my_cascade_function()"
function my_cascade_function()
$x('SELECT_CHILD_ITEM').disabled=true;
//do ajax request here
//process retrun value, create select list
$x('SELECT_CHILD_ITEM').disabled=false;
}Does that help ? -
Select list and date picker on one line - is this a bug?
I'm using: Application Express 3.2.0.00.27
Is the following a bug? If so, how do I get it reported so it will be fixed in a future release of APEX? If not, how do I do it so it ends up the way I want?
1. create blank page
2. create html region
3. create "select list" item (Begin On New Line - Yes, ...Field - Yes, ColSpan - 1, Row Span - 1)
4. create date picker item (Begin On New Line - No, ...Field - No, ColSpan - 1, Row Span - 1)
There will be other items displayed in more columns above what I just had you create above. I want the select list and the date picker to display next to each other on same line, so I placed date picker item on same line in same field as select list item.
HOWEVER... the date picker ends up displayed under the select list item (kind of), instead of next to it on the same line.
Here's what I get:
...................... [Select List Field] Date Picker Label
Select List Label
...................... [Date Picker Field]
Here's what I want:
Select List Label [Select List Field] Date Picker Label [Date Picker Field]
Thanks,
Steve
Edited by: sskelton on Aug 3, 2009 11:01 AM
Edited by: sskelton on Aug 3, 2009 11:02 AMHi Steve,
I'm not sure if it's the official way, but you could add a post here: Enhancement Request Thread : Post 3.1 - that's what I've been doing :D
Andy
Maybe you are looking for
-
How to synch multiple ios devices without making multiple copies on Mac
I keep most content on Mac Mini. Prior to Christmas, we were using about 200 GB of the 750 GB hard drive on the Mac Mini. At Christmas, we added 5 iPads for the family. We synch each iPad to a shared iTunes library on the Mac Mini. Suddenly, the e
-
Safari and itunes quit unexpectedly before they boot on osx 10.9.4
itunes and safari quite unexpectedly before boot up. I completed a advanced hardware test with the boot cd that came with the mac and found no problems, also repaired all my permissions and still having a problem Everything was working fine previous
-
How can I verify that an email was sent?
I was an Adobe SendNow Outlook user until early this morning, when I had to send an important document for a meeting this morning. SendNow for Outlook informed me that it just retired, and so I was directed to this Adobe Send cloud version. I was
-
Photostream not appearing in iPhoto
I had to reset my iPhone, and with that, update to iOS 8. Since then, photos I have taken on my phone are not showing up in my photostream album when i open iPhoto on my laptop.
-
HT204053 how can i get my contact back to my iphone
how can i get my contact back to my iphone from icloud