Strange SSRS parameter behavior - ssrs-2012

I have a parameter in SSRS called Team. The parameter is populated by this SQL:
Select Distinct TeamName
From TeamOrganization
Where PersonUnit in (#Units)
Union All
Select 'Unknown'
Order by TeamName
When I run this, the Team drop down works fine. However, when I change the SQL to this:
Select Distinct TeamName
From TeamOrganization
Where PersonUnit in (#Units)
And PeriodEndDate > #DerivedEndDate
Union All
Select 'Unknown'
Order by TeamName
The parameter drop down for Team is grayed out and I can't do anything with it until I press the "Create Report" button. The Team parameter is after the DerivedEndDate and Units parameters, so that's not what's holding things up. I've made this change to other reports in the project with no problems.

Related

Error with a user defined report in Oracel SQL Developer - Missing IN or OUT parameter at index:: 1

I have created a user defined report within Oracle SQL Developer, with a bind variable.
The report consists of a master_report (style is table), child_report_a containing with a style of 'table' and child_report_b which is the same query, but with the style of 'script'.
I am able to select a cell/row of my master report, and child_report_a data changes accordingly (ie, it returns the cells of the same date I selected.
However, when I try to view this in child_report_b (With the 'script' style) it errors with "Missing IN or OUT parameter at index:: 1".
So the setup is:
tablea
id_pk (number)
name_pk (varchar2)
1
Jack
2
John
3
Amy
tableb
id_fk (number)
start_time(timestamp(6))
1
01-JAN-23 12.00.00.123000000
2
01-JAN-23 13.00.00.123000000
3
02-JAN-23 14.05.00.123000000
User Defined Report:
master_report (Style=Table):
SELECT * FROM tablea
child_report_a (Style=Table) & child_report_b (Style=Script):
SELECT * FROM tablea a INNER JOIN tableb b ON b.id_fk = a.id_pk WHERE trunc(start_time) = trunc(to_timestamp(:STARTTIME)
Any help is appreciated.
EDIT: Included better example of setup.
My goal is to be able to select a row from the master_report, and the child_report_b would return all results which match the date (as currently happens in child_report_a) in the script format.
Welcome to StackOverflow!
The reporting feature is one of my favorites in SQL Developer, so I will try to get you started.
We can't technically answer your question without a fair bit of guessing. We know what's happening on one side of the JOIN, you have a timestamp that you're using TRUNC on.
But we can't tell what is on the other side of the equality predicate in your JOIN.
Here's a working example, see if this helps you.
Parent Query
select trunc(systimestamp) A
from dual
Child Query
select object_name, object_type, last_ddl_time
from user_objects where :A > (trunc(systimestamp) - 30)
And the report -
To debug your report, substitute the bind :STARTTIME with a literal value that is equivalent to what your parent query would return. If that works, so should your report.
Disclaimer: I work for Oracle and am a product manager for SQL Developer.

How to check a checkbox in Apex 18 when its value is present in other table

I have a checkbox with list of values from table a. I need them to be checked if are present in a column of table b. Do you have any ready solution please colleagues ?
Thx
Adam
See this similar question for some background info.
When you're working with a multi-value checkbox item, you want your Source Query to select a colon-delimited list of the values that you want to be checked in your checkbox. (This is true for multi-value Application Express page items in general.) E.g.
select listagg(my_column, ':') within group (order by my_column)
from TableB
where my_column is the name of the column in TableB that your values are stored in.
If you have a lot of values in TableB (enough that the listagg() above returns more than 4000 characters), you'll need a fancier query, but for most cases it'll work fine.

Error with Report Page in Oracle Application Express

I have a report based on a SQL Query, the report has 3 columns from v$session.
select distinct to_char(SQL_EXEC_START, 'DD/MM/YYYY HH24:MI') TIME_STARTED, module REPORT_NAME, action CURRENT_STEP from v$session where module like '%BOB%'
In SQL Developer, the query brings up what you would expect. However in the APEX report page, no matter what is in v$session, I always get (in addition) the following displayed at the top of the report page, in the actual report columns:
<DATE> Processes - point: BEFORE_BOX_BODY BOB01/APEX:APP 104:7
Can anyone tell me how to get rid of it, and simply output the query results into the report page, and nothing else?
It seems that it displays current report as well. So - remove it, e.g.
select distinct
to_char(SQL_EXEC_START, 'DD/MM/YYYY HH24:MI') TIME_STARTED,
module REPORT_NAME,
action CURRENT_STEP
from v$session
where module like '%BOB%'
-- add this
and module not like '%104:7%'
and current_step not like '%BEFORE_BOX_BODY%'

Apex 5.0 : Action on buttons ? Get value from textfield?

The first problem is that I have a button. I created a process called nextweek( to get data for next week from reservation table). I tried this The PL/SQL only as a trial:
begin
if :RESERVNO is null then
select RESERVNO
into :RESERVNO
from reservation;
end if;
end;
but the page keeps telling me "NO DATA FOUND". I would like to create a report with the result of my PL/SQL Query
My second problem is that I want to take values from a textfield and use it in my PL/SQL Query in another button as the "ACCEPT" in oracle.
As I understand, you need following:
Create report: click Create new page button (or create region if you already have a page), then choose region type Report. Write your source SQL query in the field Region source (choose Source type - SQL Query).
Create an item (textfield). For example, with the name P_MY_ITEM
Create a button. Here you don't need to change default properties. (Action on button click should be Submit page)
Add this item name to the source query in the region. It should look like:
select column1, column2, column3
from table1, table2, table3
where column4 = :P_MY_ITEM
and <other conditions>
After that, user can write something to the input field and press the button, page will be reloaded, and report will be changed accordingly to the item value.

Oracle Apex 4.2 interactive report with lookup tables

I have created a table Called NAMES inside that I have a column called Status.
On STATUS, I created a lookup table and this created a new table called Status_lookup Which has 2 column (STATUS_ID and Status)
So the NAMES table column changed to STATUS_ID
when I do interactive reports, the data do come through from STATUS_ID which is number, I need the text that is stored in the Status.
Could some please explain how I do this. This I thought would be pretty easy but I can't see how to do it.
I am not Newbie to Oracle applications so a step by step would be helpful
Example: select * from emp
I want DEPTNO to display the DNAME which can be found in DEPT
What I usually do is:
Go to "Shared Components > Lists of Values", and create a new one from scratch, type dynamic.
I'm calling my LOV "DEPARTMENTS", and it has this SQL:
select dname d, deptno r
from dept
order by 1
To then map this to the column in the IR, go to the page with the IR and edit it. Go to the report attributes. From there you can see the columns in the IR and edit their attributes by clicking the pencil icon.
In the column attributes you can then change the display type of the column. Set it to "Display as Text (based on LOV, escape special characters)".
Then go to the "List of Values" section, and select the LOV from the "Named List of Values" select list. (In my example this is "DEPARTMENTS").
Apex will then map the values in the IR sql to that of the display value of the LOV.
Alternatively, you could of course also just change the SQL of the report to map a display value, for example:
SELECT empno, ename, depto, (select dname from dept where deptno = e.deptno) dname
from emp

Resources