I am using Cognos 11.0.8 version . I am using a multi select check box which pulls data from database. I have another multi select checkbox, which gets populated based on the values selected in the first multi select checkbox.
On selecting the items in the first multi select box ( on the focus out ) , I want to populate the second multi select check box based on the values selected. How to achieve this using JavaScript ?
Another doubt: In the SQL database, I have a column of type nvarchar . Since this column type is not in Cognos, what should be used as the equivalent in Cognos ?
Using Multi-select = Yes and Auto-submit = yes was possible in 10.2.1 (and maybe 11.0.4). At some point IBM decided that combination would cause performance problems in reports and make report users unhappy. (My response was, "Isn't that the report developers call?")
It is possible to use Multi-select = Yes and Auto-submit = Yes together, but not through the UI. You'll need to update the report specification (XML) manually.
Cognos: Report -> Copy report to clipboard
Text editor: Find the value prompt you want to modify, and add autoSubmit="true" at the end of the opening tag.
Text editor: Select all, copy.
Cognos: Report -> Open report from clipboard.
Updates to the downstream value prompt will occur on onclick, not onblur.
If you touch the Multi-line or Auto-submit properties again in the GUI, you may lose the setting.
For NVARCHAR, switch the data source connection to use the 32-bit native SQL Server client
https://www.ibm.com/support/pages/framework-manager-imports-datetime-and-datetime2-columns-nvarchar
You probably do not need to update XML manually
Adding an optional filter and adjusting some properties may be enough
Let's say we have the main query and a relationship in the data (like Sales reps and they belong to a Region)
Two data items and corresponding queries:
Query 1 for your prompt for [Region]
Query 2 for your prompt for [Sales Rep]
Query 3 is your main query for your report (list, crosstab, etc)
First multi select check box for [Region] and has a parm called ParmRegion (this is based on Query 1)
For the second multi-select check box (let's say that is Sales Reps)
Add OPTIONAL filter on Query2 for the multi-select prompt (not the main query for the report) like this
[Region] IN(?ParmRegion?)
add a reprompt button if you need
This way when you select content, the query that builds the second prompt is adjusted to only show Sales Reps that belong to that region
Related
I am using select-2, a flexible/searchable dropdown using jQuery (I know, I know). I have two sets of users like this:
- Some user option group
-- User A
-- User B
- Another user option group
-- User A
-- User C
Is there any way with Select2 to determine if User A was clicked in the second group? The hacky way I thought to do it was append the ID string to be ID+some_uniq_id which I then strip when I save it.
Screenshot example
I need to filter data based on whether the user is in either list.
I am looking for a way of adding functionality to a text area input on an HTML page where you can write into a text field and as you type, if you add an ampersand and #start_typing it would provide you with a list of options which will incrementally reduce as you type more of the letters of a word from the list.
I basically want what you can do in Atlassian Confluence when you add a colleague into a page or comment. I want to be able to add one or more value in a text input with the help of a list of options.
I have found autocomplete from a drop list as you type as an alternative to select from a list but that is where the selection is the only thing that ends up in the onscreen variable.
For example, I want to type #gross_value = #net_value + #tax_value and at each point of adding an # in that entire sentence, it would drop a list of options I can either select from or keep typing (using the list as a reference just like you do in Visual Studio Code.)
So here's my code example below. In my use case, I know the name of the list I want to use, it would be schema_values (a list of origin and destination schema values used in mapping) and I know that I would use one of those values more than once in a formula.
In the context of the example below, I might want to type the sentence, 'my favourite car is a #Saab and I don't really like #Skoda' - what I would expect to happen is as I type the # I get the full list of cars then when I type S I only get the options for SaaB and Skoda and when I've selected or finished typing the item which exists in the list, it leaves the ampersand there.
I have a program which transforms from one data schema to another and the interface requires me to create formulas which include the selection of values to set the from and to parameters which match the schema values which I will put together in a set of options as shown.
It would be used for a mathematical calculation or to map from one value to another. The purpose of the interface is to create a configuration file which can be processed by an application.
<input type="text" list="cars" />
<datalist id="cars">
<option>Volvo</option>
<option>Saab</option>
<option>Skoda</option>
<option>Mercedes</option>
<option>Audi</option>
</datalist>
Morning,
I'm currently using an Interactive Report on APEX that contains several columns, some of them being checkboxes that represent if a certain number is present in the table that is being used to fill the report.
For example, row 1 has a telephone number "99091021", row 2 a provider, and the following 5 rows are checkboxes that should represent branches in certain areas. If a checkbox is clicked, it means that this number is present in that area.
Now, I'd like to create a dynamic action that inserts that number into that table when I click the checkbox (and it becomes checked), and a delete for when it's also clicked (and becomes unchecked). Problem is, I don't know how to access the rest of the data in the row of the IR to use as a comparison for the delete and insert statements.
Say I try to click the Checkbox 3 on the row where the telephone number is "99091021". A dynamic function would get the data row, then a true action would compare the necessary data to perform either an insert or delete, depending on the state of the checkbox. That's the plan.
I've done something similar before, using localStorage, but it didn't quite work, because before I used it on an interactive grid. Is there a similar function for interactive reports?
Also, is there a way to check if a checkbox is checked or unchecked in a PL/SQL Code?
Here's the solution I found:
I had a select that got the necessary data for the Interactive Report, but because I kept getting an error of temporary data table being exceeded and always breaking the server, I had to change the checkbox query to something like this:
apex_item.checkbox (1, '1_'||a.pk, case when max(decode(b.nr,1,1,null)) is null then '' else 'CHECKED' end) as checkbox1
The '1_' part represents me selecting the first checkbox. With the value still there as the selection, I was able to do the following:
$s("P165_GET_PK",this.triggeringElement.value)
The result would basically be "1_PK_number". With this function I was able to get the value (a.pk) hidden in the checkbox to an Apex item, and then continue using it for my insert and delete statements. It's just a matter of separating the value in it with substring functions and so on.
Now I can delete or insert new data inside that table with a simple click.
I hope it helps in case someone tries doing something similar.
can anyone please suggest , how to add new option to drop down list (using select tag in html) so that user can enter the new value and on submit it should be appended to the existing list ..i am able to populate it's option list via DB dynamically and it's working properly
i am having 5 drop down mutually exclusive category lists in a single table row and i am providing them some initial options.Now i want that if the list contains user's required option then user can select from existing one ...else it should be able to add a new entry to that list & it should be simultaneously updated in DB on submit.
Follow this steps
As you are populating the drop down from databse . So its better to add the value in database only.
I think your user will be entering the value in a text box. So on submit call a method or servlet which can be used to add the value in the database field from which you are populating the drop down.
After updation make your servlet to return on the same page.
Now you can see your new option in the drop down.
Update on further problem explaination
For your problem do one thing
Give a text box in last option of each dropdown.
Select an event in which after the new value entered by user in that text box an java script function can be triggered line onmouseout.
In that function call get the text value .
Now call your servlet or method or whatever you are using to update the db with value value in the column corresponding to that drop down using Ajax or normally.
Refresh the page.
hiii,
finally it's done.
i used following function as-
function abc()
{
var myoption = document.createElement("option"); //works with both mozilla and IE
myoption.text ="mytext";
myoption.id="mytext";
myoption.name="mytext";
myoption.value ="mytext"; //Probably, the sID stuff
document.getElementById("drop_1").options.add(myoption);
}
& so on within loop.
thanks to all .
I have a tabular report that allows the user to enter a reference number (text item) as well as a comment textarea item.
The report can vary in amount of records displayed, but for this example, let's say I have 10 records in the report.
What I am after is to create two new fields identifying both comment and reference no field - let the user type info in these two fields and then have a "Populate All" button that will go through each record in the report and assign the reference number value and comment value to each of the 10 records.
It's not completely clear what you're trying to do here. Do you have a regular HTML form laid out in a table, and then the last two table cells on each row have an input/text area element in them? If so, I would think the easiest way to go about it would be to assign a common class to the input elements in each column, such as 'refno' and 'comment' then have some code like this in the 'PopulateAll' button onclick event:
$(".refno").each(function() {this.value = $($("#refglobal").value)});
This assumes your field for adding the reference number to all has an id of refglobal and that you're using jQuery (though other libraries will allow similar syntax, and coding it out longhand wouldn't be too much effort in this case).