Dynamic Checkboxes on Interactive Report
I have an interactive report that currently lists a row of values:
Field1
Val1
Val2
Val3
I would like to place a text-field at the top of this interactive report with a submit button:
[textbox] [submit button]
Field 1
Val1
Val2
Va3
Then I would like to have checkboxes [] appear in each row:
[textbox] [submit button]
Field1 | Checkbox
Val1 | []
Val2 | []
Val3 | []
Then I would like to make it so that the user enters some text into the textbox and selects any number of the row checkboxes. Upon hitting submit, a procedure will run that accepts each Field1 value and inserts a record into a table containing 2 fields: the Field1 value and the textbox text.
So the following user input:
[Test text in the textbox.] [submit button]
Field1 | Checkbox
Val1 | []
Val2 | [x]
Va3 | [x]
After hitting the submit button, a procedure would be called that would insert 2 records into a table:
Field1 | Field2
Val2 | Test text in the textbox.
Val3 | Test text in the textbox.
Note that there is no entry for Val1 because its checkbox was not checked when the user pressed submit.
What can I do to make this happen? I appreciate any help you can offer.
Thanks for sharing
I am having exactly the same problem.
I have an interactive report with the following SQL.
select RSN_CD,
DESC,
APEX_ITEM.CHECKBOX(1,RSN_CD) "Select"
from CAN_RSN
I've set the 'Select' column's type to 'Standard Report Column'. But the checkbox does not appear on the report.
Apex Version: 4.0.1.00.03
Thanks.
Similar Messages
-
Dynamic action with interactive report region refresh
Hi!
I'm using APEX 4.02
I've got a page with 2 regions.
Region1 is a (input) form
Region2 is an interactive report on the same table as region 1
When entering values on the form I'm trying to dynmically lookup similar records in the table with the interactive report.
I've made a dynamic action on the change of the form fields which should refresh the interactive report region. I can see this one fires if I add a alert to debug if it fires.
The dynamic report is based on a query with bind variables pointing to the form fields, for example
where
field1 = :P2_FIELD1
This works great on the page load, so no dynamic action is fired but I can see the rows in the report region are the ones I am looking for.
But the refresh of the report region is not working, it is never refreshing and/or showing the correct data after a change of the form fields, so it looks like the dynamic action "refresh region" is not working on the interactive report.
Any ideas why this can go wrong ?
I would like to solve this using standard dynamic actions and preferrably not via PL/SQL or JS, shoudl be possible if I should believe the documentation... ;)
Cheers
Bas
Edited by: bklerk on 26-apr-2011 3:07Hi,
When you change value to item, I assume you do not set value to session state.
Use interactive report advanced attributes "Page Items to Submit" , set items session state before report is refreshed.
http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/app_comp.htm#sthref1235
Similar post/issue here
Hide and show region - hides on refresh
Regards,
Jari -
Selecting the Checkboxes on Interactive Report
Hello
I have two checkboxes on a Interactive Report:
My query is as follows:
select
apex_item.checkbox(1, empno, 'ENABLED'),
apex_item.checkbox(2, deptno, 'ENABLED'),
ename,
sal
from emp;
I have a conditional button 'Check N Update' which will invoke the Pl/SQL process:
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
l_empno := APEX_APPLICATION.G_F01(i);
UPDATE XXX ....;
END LOOP;
FOR i in 1..APEX_APPLICATION.G_F02.count
LOOP
l_empno := APEX_APPLICATION.G_F02(i);
UPDATE XXX ....;
END LOOP;
What I need is I need to check a CONDITION, if BOTH the checkbox's are selected then I need to throw an ERROR saying.
YOU CANNOT SELECT BOTH the boxes.
Please let me know how can I get this.
Appreciate your help.
thanksHi
Using a RadioGroup would actually create one radio button for each line and mean that you could only select one line.
As the submit process will only return the boxes that have been checked, you only have access to the ticked items and as these contain just the EMPNO and DEPTNO values, you have no way to check if any two are from the same row.
This means that you will have to rethink your report slightly. You will need to have two checkboxes with ROWNUM as the value (if the report is sorted somehow, this may make this more awkward as ROWNUM is from the unsorted data) and make your EMPNO and DEPTNO hidden fields. The when the user submits the page, you will have to compare the ROWNUM values for the first column with all the ROWNUM values for the second column to see if there's a match.
As an alternative, you could have a select list for the first item and give the user options for EMPNO, DEPTNO, Both, Neither?
Andy -
Dynamic Headings on Interactive Report
Hi,
I have an interactive report that I would like to use dynamic headings. I have looked at some of the posts here and have followed what I think is the correct way to do this, but I am still not seeing the headings I am expecting.
I created items to hold the headings and have created a process to populate these items, that all seems to work fine, I can view the session state and see the headings.
I added the items to the report on the Report Attributes page under "Heading". I used the substitution for the items as &P2_HEADING1.
When I look at the report all I see for the substituted heading is &P2_HEADING1. and not the value I would expect.
It seems I am missing a step? Any ideas?
Thanks,
PeterHi,
The process point should be ok.
The only other things I can think of are either there is an error in the code (the "Session" link on the developer's toobar will show if the value is being set) or there is a space after the page item name (difficult to see on screen but can cause problems) which makes the item name different to what you expect.
Andy -
Dynamic Heading in Interactive Report
In standard reports it is possible to create dynamic headings using PL/SQL.
Does anyone know of a way of doing this for Interactive Reports?
I have a report that needs to change date headings dependant on the selected start date.
Thanks,
JonItem names (or built-in names like APP_ID) appearing in HTML and which begin with ampersand and end with a period are substituted with their session state values only when the names are upper case. The reason for this is to increase parsing efficiency with respect to differentiation between Application Express references and standard HTML references such as:
&_nbsp;
&_amp;
&_lt;
&_gt;
...etc., (ignore underscore in each of the above).
This ought to be documented better.
Scott -
Setting Value of apex_item.checkbox in interactive report
Forum
We need a "select all" and "unselect all" functionality in an interactive report ...
The IR Query currently goes something like this :
select
OBJ_LABEL",
"DATA_START_DATE",
"S_ROWSTATE",
"S_ROWVERSION",
APEX_ITEM.CHECKBOX(1,item_id, 'Checked') "Select"
from some_table;
We have the checkbox selected by default .... the question now is how to have an "unselect all" and "select all" function or heading in the Interactive Report that would unset or set the checkboxes for all rows in the report.
Any advice will be helpful ....
Thanks
PierreAnswering our own question :-)
1) Add an unselect and select button and a hidden field
2) modify the query to use the value of the hidden field to determine whether the checkbox is set or not.
3) set the value of the hidden field as appropriate with for the select or unselect event when the button is selected.
P. -
Dynamic Title for Interactive Report?
I have an interactive report where I am passing in interative report filters. This is great becase it allows me to reuse a single interactive report in different ways. However, one drawback I am running into is the report title. I'd really like to be able to change the report title based on the filters that I pass in. Is this possible? Can the report title be dynamic?
Thanks,
Andrew WatsonIt,s possible.
I'm using item references to alter the report title.
Set the item value to the title that you want for your report and the region name as the example.
Example: Report &P1_ITEM. &P1_ITEM1. &P1_ITEM2. and so far. -
Dynamic Filter on Interactive Reports
Great job guys on the new Interactive Reports feature of 3.1
I can't express how much time this will save us in our development effort and how much real estate on the screen is saved by not having to create our own report filters.
My question is this:
Say you have defined a default filter that returns all rows that were created between 01-JAN-1999 and 31-DEC-2999 (all rows in our application)
Is it possible the make the 2 dates dynamic in the filter i.e. I would like to default these to the start and end date of the current month?
Thanks for any help or suggestions
DuncsI think I may have found the answer using the "In the Last" operator
Will post my solution once implemented
Duncs -
Creating a process with Checkbox inside interactive report
close
Edited by: mang jose on Feb 4, 2011 9:21 PMHi,
Create dynamic Action. Select Advanced
Event: After Refresh
Selection Type: Region
Region: {select your report region}
Condition: No Condition
Action: Execute JavaScript code
Fire On Page Load: True
Code:
$('.apexir_WORKSHEET_DATA input[name="f01"]:checked').each(function(){
$(this).parents("tr:eq(0)").children().css({"background-color":"#00FF66"})
})Selection Type: None
I did updated my sample
https://apex.oracle.com/pls/apex/f?p=40323:53
Regards,
Jari -
Hi all,
Is it possible to alter the sql query of an interactive report, in a dynamic way? I want load a given query, in execution time, to an interactive report.
How can i access the internal ApEx database tables? Could i write into the table responsible for storing Interactive Report information?? I only know the existence of views like APEX_APPLICATION_ ....
Regards Pedro.Hi Pedro,
Currently Apex doesn't support dynamic queries in interactive report however you can achieve it using apex collections. Create a before header pl-sql process to create a collection using dynamic sql query and then build the interactive report by selecting data from above collection.
Hope it helps.
Thanks,
Manish -
I have two issues with respect to Interactive Report in ApEx
1. I used the Aggegrate Function to sum up the values. Though the Values are displayed, i want to have the Wordings " Totals". How to go about that
2. In the Interactive Report, i use the Highlight option to color a set of rows based on some condition. Now after saving the report (primary), i as an end user still see the Query Part with an X. As a developer i dont want my end users to see that portion. From the end user point of view, he should be able to see the report with various colors as defined by me, but without seeing the X mark. (I got the answer to this through another forum,..thanks)
But the first one still remains...
Kindly help.
Edited by: Vraj2k on Nov 25, 2011 4:50 PMHello,
Do you want some customers appear twice or not in your top 10?
If not in your select you would need to specify DISTINCT (or probably look a bit more inside the query because you might have a cartesian product that makes the rows appear more than once).
Next you can order by Value and then only show the first 10. You can do that dynamically with the interactive report or directly in your query. On Asktom you see some nice examples about top n queries: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2853107469873
Regards,
Dimitri
http://dgielis.blogspot.com/
http://www.apex-evangelists.com/
http://www.apexblogs.info/
REWARDS: Please remember to mark helpful or correct posts on the forum -
Interactive report with checkbox and editable field
Hi,
For a project I'm working on I need to create a interactive report in Apex 3.2 with the ability to select lines and to modify one of the columns in the report.
To do this, I started off by adding these two fields to the selection query of my IR:
apex_item.checkbox(1, product_number) cb
and
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER
cb is the checkbox files, and QTY_TO_ORDER is the editable field.
That worked like a charm and I got my two fields in the report.
To process the values, I added this page process, wich for now should only store the "product number" and "QTY_TO_ORDER" fields in a table.
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i));
END LOOP;
commit;
end;
However, this doesn’t work the way I want it to work. When I check the checkboxes of two rows, it will store two rows with the right product numbers, but it will take the top two QTY_TO_ORDER field of the table regardless of which ones are checked. I was able to solve this problem, by adding a rownum to the query and using the rownum as the value for the checkbox. Since I still need the product_number and qty_to order fields I made them both text fields.
I changed my page process to:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i)),
APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i)));
END LOOP;
commit;
end;
This seemed to solve the problem, and I now got the right values in the table, unless I used sorting in the report... As soon as I sorted the report in a way different than by rownum, I got the wrong values in the table. The reason for this is of course that my insert just selects the nTh row from the table, and my rownums aren't dynamic.
I've found a lot of examples on the internet using '#ROWNUM#' in the selection, which should dynamically generate a rownum in the report. This seems to work in normal report, but in a interactive reports, the literal values '#ROWNUM#' shows up.
Is there any way to solve this issue?Hi,
Try with 3 fields:
apex_item.checkbox(1, product_number) cb,
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER,
apex_item.hidden(3, product_number) prod_no
The hidden field should be display as a hidden column.
Then your process can be:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
FOR j in 1..APEX_APPLICATION.G_F03.count LOOP
IF APEX_APPLICATION.G_F01(i) = APEX_APPLICATION.G_F03(j)) THEN
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(j));
exit;
END IF;
END LOOP;
END LOOP; -
Dynamically Colour Cells in an Interactive Report
My application requires an interactive report where cells are colour coded and the cell may, or may not have a value, but the value doesn't relate to the colour.
The report is based on a view which returns a result set as follows:
rn col1_value col1_colour col2_value col2_colour col3_value col3_colour col4_value col4_colour
1 null grey 3 null null null null red
2 null null 3 grey null null 4 red
3 null grey null null 3 null null redIn the results, each cell to be displayed has two columns per row, one with the colour and one with the value to display where null is the default colour (white)/no value.
In Apex 4.1 I can set the colour based on the values using the dynamic actions on the report display, but I can't work out how to set the colour of col1_value based on the results of col1_colour. I am hoping there is a way to set the colour of the cell col1_value and hide col1_colour from the report.
If you know of any posts providing an example of how this may work, or if you are able to explain it to me I would really appreciate your time.
I appreciate it may not be simple to see what I am aiming for given the text restriction and no images/tables available on the forum, hopefully you get the idea, but if not, ask and I will try and explain further.
I have seen Blog posts about 3-4 years old on how you do this in Apex 3.0 or older, but can't work out how to get this to work in Apex 4.0 or Apex 4.1.I have solved this using Javascript in a Dynamic Action, javascript something like:
$("td[headers='COL1_COLOUR']").each(function(){
switch($(this).text())
case "grey":
$(this).parent().children("td[headers='COL1_VALUE']").css({"background-color":"#999"});
break;
case "green":
$(this).parent().children("td[headers='COL1_VALUE']").css({"background-color":"green"});
break;
case "blue":
$(this).parent().children("td[headers='COL1_VALUE']").css({"background-color":"blue"});
break;
case "orange":
$(this).parent().children("td[headers='COL1_VALUE']").css({"background-color":"orange"});
break;
case "yellow":
$(this).parent().children("td[headers='COL1_VALUE']").css({"background-color":"yellow"});
break;
default:
break;
$(this).css({"visibility":"hidden"});
$("th[id='COL1_COLOUR']").css({"visibility":"hidden"});
}); -
Dynamically set maximum row count in Interactive Report
Hi,
Has anyone worked out a way of dynamically setting (e.g. via select list) the maximum row count value for an Interactive Report, taking into account issues with order by when the report is filtered. I'm aware of solutions like this: http://www.talkapex.com/2010/10/apex-reports-no-limit-downloads.html but as far as I can tell this doesn't work when the report is filtered and the IR is rewritten in the background. Data sets then become unreliable because they are reordered.
Thanks,
MikeHi Mike,
You can do that with javascript
gReport.search('SEARCH',100)the 100 you can replace for any number you like.I have a report with filter,sorting and groups and it is gives no problem there.
any number means any number but not higher than the number you set at Maximum Rows Per Page.
You probably can mix the solution from Martin and the above code.
Regards,
Kees Vlek
<tt>Company: http://www.orcado.nl
Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
Twitter: http://www.twitter.com/skier66</tt>
If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.
Edited by: kvlek on 24-apr-2013 12:29
Edited by: kvlek on 24-apr-2013 12:35 -
Tabular form validation(Checkbox) is not working for Interactive report
Hi,
I am using the oracle apex 4.0 and oracle 11g.
I have written a below select query on interactive report as
select
apex_item.checkbox(1,RESIDD)||apex_item.hidden(2,RESIDD) row_selector,
apex_item.text(3,RESNUM) as resnum
from "PDRRES"
and written the validation to display the error message( Function returning error text ) as
DECLARE
vRow BINARY_INTEGER;
BEGIN
-- apex_application.g_print_success_message := NULL;
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
vRow := apex_application.g_f01(i);
apex_application.g_print_success_message := apex_application.g_f01(i)||'-'|| apex_application.g_f03(vRow) ;
END LOOP;
END;
Output : No data found error message
As far as it work for sql report with above logic because apex built in row selector
but it fails in case of interactive report for some reason.
Please suggest.Saroj Nayak wrote:
Hi,
I am using the oracle apex 4.0 and oracle 11g.
I have written a below select query on interactive report as
select
apex_item.checkbox(1,RESIDD)||apex_item.hidden(2,RESIDD) row_selector,
apex_item.text(3,RESNUM) as resnum
from "PDRRES"
and written the validation to display the error message( Function returning error text ) as
DECLARE
vRow BINARY_INTEGER;
BEGIN
-- apex_application.g_print_success_message := NULL;
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
vRow := apex_application.g_f01(i);
apex_application.g_print_success_message := apex_application.g_f01(i)||'-'|| apex_application.g_f03(vRow) ;
END LOOP;
END;
Output : No data found error message
As far as it work for sql report with above logic because apex built in row selector
but it fails in case of interactive report for some reason.
Please suggest.NO DATA FOUND usually occurs when an i mplicit select does not find anything. It can also occur when referencing a collection element that has not been defined.
You have 2 collectinons in the code you posted, apex_application.g_f01() and apex_applciation.g_f03. Since you are looping therough the COUNT attribute of g_f01 its reference ("I") is probably okay and the value store in vRow is probably not right. You can check this by using RAISE_APPLICTION_ERROR to see the value something like
raise_application_error(-20000,'vRow="'||vRo2||'"');Remember that working with checkboxes is tricky. If the box is not checked nothing will be sent. You may need to define a default value when no value is submitted.
Maybe you are looking for
-
PNP Selection Screen Modification
Hi All, Can anyone tell how to remove the payroll period section completely from the pnp selection screen. I tried all the means going to HR Report Category, I couldnt find the perfect category to hide the payroll period selection. It neither allow m
-
Why does the photo downloader close all of the image files from which I am selecting files for downloader once the selected files have been donloaded? I have to then start again, and wait for all of the image file thumbnails to once again open.
-
Youtube videos stop playing-appears not to be a browser problem
Hi everyone, This is my first time posting here, I've always managed to find a solution to my previous mac problems with a little bit of googling around, but not this time so I really hope someone can help me out here. It's been going on for about 2
-
Trigger a program in ECC from BI using a process chain with out Program
Hi, How can we trigger a program which is in ECC system from BI using a process chain with out writing any program. is it possible? if yes how can we achieve this. Thanks & Regards, Madhu
-
BEA-160197: Simple ADF application fails to deploy on integrated weblogic
JDeveloper 11.1.1.6.0 Simple JSF ADF application fails to test localy on integrated weblogic. I have never seen this and have no clue where to look for the problem. Anyone? [01:11:01 PM] Deploying Application... <23.05.2012. 13.11.01 CEST> <Error> <J