Oracle Apex 5.1: Report column based on LOV(List of values) showing returned value not display value - oracle

I have created an interactive report with a form. In the form I have two select lists. The first select list is a list of values defined in the shared component. And the second select list is another list of values which is also defined in the shared component but this select list populates its LOV based on the selected item in the first select list.
Let the names of the select lists are:
Region.
Country(which is dependent on the selected item in Region field).
Now when I press save/create button in the form, a row is created in the report. The Region column and Country column in the report are both "Plain Text(based on List of Values)". But what I see is the Region column is showing the correct display value of the LOV but the Country column is showing the returned value of the LOV.
I want both of these columns show the display values rather than the returned value. Could anyone help me find the solution?

Are you using the same LOVs in form and interactive report? If so and in the conditional LOV (countries) you refer your form item (ex. PX_REGION) it will not work correctly in IR. Probably IR is showing the returned value because the option "show extra values" is checked.
If this is the case my suggestion is to change your IR and instead of a "Plain Text(based on List of Values)" you make it plain text and change the query to an inline query in IR query to obtain the value you want to show.
If you don't want/like to put your LOV queries in different places I suggest you to use this approach shared by Nick Buytaert
Hope this helps you solve your problem.

Related

SSRS Dynamically Show Data

I am wondering if you can have other tables show based on the value selected in the main table. I am not opposed to drill-down either.
My main table is the summary and was hoping to show additional data when the user clicks on a Type. When clicked another table would be visible. For example, in the screenshot, the Pool table would be visible when the Pool type is clicked in the main report. As mentioned if this is easier as a drill-down then I will do that, but not sure how. The report currently has a dataset for each table. Do I need to combine the datasets to do a drill-down?
Main and child tables
The best way to accomplish what you described is with a drill down and you would need to combine the datasets into one.
Combine your datasets
Add a table to your report and reference the single dataset
Add your detail row group to the table - from your child table (Area, Average)
Add a parent group to your details row, group your detail row group by Type, it should add a Type column to your table. Delete this column and it will ask you to delete the associated group as well. Select the option to delete only the column.
Recreate your table by adding rows, be sure to match the grouping indicators (brackets) on the left side
Right-Click on the bottom row in the box where the bracket is to highlight the entire row, click Row Visibility. For the option "when the report is initially run:", select Hide. Check "Display can be toggled by this report item" and select the name of the textbox that contains [Type]. If you don't know what this is, exit out of the dialogue box and right-click on the cell [Type] and click Textbox properties, the Name will be in there
Repeat step 6 for the label row for your details row (second row from the bottom)

Filter Data block with a LOV value in Oracle Forms 10g

I need to implement a simple product form from a block of data called "PRODUCTS".
The products are related to a "Partner" through the field "COMPANIES_PARTNERS_ID".
This field will be represented by an LOV to select the Partner for which we want to visualize your products.
If there is not a partner currently selected, all your products should be displayed. And when a partner is selected, only their products should be displayed.
The form will look like this:
The button to the right of the search field should show the LOV and launch the query. I tried the following code as a "Smart Trigger" when I pressed the button. But it does not work well at all. The LOV list appears twice and when no partner is selected, no product appears.
Could someone help me to implement this functionality? Thank you
You don't need to use ENTER_QUERY command.
had better using DEFAULT_WHERE set with respect to COMPANIES_PARTNERS_ID. If not selected any of the rows of LOV by pressing CANCEL or dissmissing by X sign, then all of the products will be listed(In this case you'll see the first ID, most probably with value 1, since COMPANIES_PARTNERS_ID is not located at a CONTROL block but at the same block,namely PRODUCTS, with other items. As you go down by down-arrow you'll see the other ID values when your cursor is in COMPANIES_PARTNERS_ID field, seems that Number Of Items Displayed is set to 1 for this field, because PRODUCTS block has been set as 10 items displayed ).
So, you may use the following code in WHEN-BUTTON-PRESSED trigger :
DECLARE
V_WHERE VARCHAR2(500);
BEGIN
GO_ITEM('COMPANIES_PARTNERS_ID');
IF SHOW_LOV('COMPANIES_LOV') THEN
V_WHERE:='COMPANIES_PARTNERS_ID='||:COMPANIES_PARTNERS_ID;
ELSE
V_WHERE:='1=1';
END IF;
SET_BLOCK_PROPERTY('PRODUCTS',DEFAULT_WHERE,V_WHERE);
CLEAR_BLOCK(NO_VALIDATE);
EXECUTE_QUERY;
END;
Once you enter query mode (which is what ENTER_QUERY does), further processing is stopped until you execute query.
I presume that you created a LoV properly - the most usual way is to create a Record Group query first, and then create a LoV based on it.
Therefore, I'd ENTER_QUERY in WHEN-NEW-FORM-INSTANCE trigger and let your current push button display LoV and let user select a value into the "Companies Partners ID" item. Executing a query (either by pressing the corresponding toolbar button, shortcut key (F8?) or your new "Execute query" button) would then actually execute query. If master-detail relationship is properly created (using the Data Block wizard is the simplest option), then you'd get rows in the "Products" block.
Put a value in PRODUCTS block WHERE clause' property.
WHERE CLAUSE property:
COMPANIES_PARTNERS_ID LIKE NVL(:lov_block.COMPANIES_PARTNERS_ID, '%')

SSRS sort icon not showing up in header but showing up in column values

I am very new to SSRS. Infact this is my 2nd report.So in SSRS, I went to Interactive Sorting and checked the "Enable interactive sort on this text box". Chose the first radio button "Detail rows".For sort by I chose "ColumnName" and clicked ok. I ended up with a sort icon on every value .The data here may seem duplicate but it is correct. I have additional 6 columns apart from this "Product" column. I repeated the sort action for all columns same way, the only difference being the different "Sort by" column. I get the icon on all columns in all rows. I want it on the header only.
Apart from that I get this warning 6 times :[rsIneffectiveSortExpressionScope] The text box ‘ColumnName’ is defined at the scope “Details”, which is identical to the scope used as SortExpressionScope. This interactive sort has no effect at runtime, since it sorts only the particular instance itself.
What is that i am doing wrong ?and what should i do to correct it?
Rt click on the textbox with the Column Name, click on
Interactive Sorting
then Check
Enable Interactive Sorting on this textbox
and then select the appropriate group you want to sort.
AFTER EDIT
if you dont have any groups yet, just select Details Row. If you have/create any group, then you need to select the radio button Group.
The sort by will actually have the column you want to sort with.

Adding TextBox in FORM with AddNew Button

I am working in Oracle Apex .i want to add TextBox i-e Disease from AddNew Button because i have Multiple Entries for one TextBox.The entries will be selected from another table through POPUP LOV. Below is the picture.
I don't think I can explain it step by step here, but it sounds like you could make use of a Tabular Form in your case.
In a Tabular form, you can dynamically add-update-delete new rows with a button, and for each field you can have Popop LOVS or Comboboxes to select data from.
Here are a few things to note:
When you insert a Tabular Form in your page, you'll instantly get three processes; one for Automated Row Fetching and two for save-update operations. By default, these processes are triggered through a button. You might want to change that since you have other items to submit in your page.
In a tabular form, you define a SQL query and the resulting columns of that query becomes your fields. For each field, you can select whether you want it to be a Combobox, Popup LOV etc.
Since you want to use a single column "DISEASE" in your treatment table, you can use one of the list item types that support multiple values (generally separated by colons (:)) - for example, a Shuttle.

How to populate dynamically generated select boxes with ajax

I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x

Resources