Jdev 10g, ADF- expression based on column value
Hi,
I have an ADF table with a column in it that is populated through a data control. The column can be one of five values (1 - 5) which mean different statuses (Approved, Denied, Pending, etc). I was just wondering if anyone could recommend a way to do the translation in the table column.
I was looking at the expression builder but it didn't seem like it would take more than the #{row.Status==1 ? 'Approved': 'Others'} and I have 5 different statuses that I'd like displayed to the user.
Thanks
Hi,
yes you can nest conditions like here:
inlineStyle="#{row.Status == '1' and row.ErrStatus == '0' ? 'color:rgb(0,255,0);' : row.Status == '2' and row.ErrStatus == '0' ? 'color:rgb(210,170,0);' : row.ErrStatus == '1' or row.ErrStatus == '5' ? 'color:rgb(0,0,255);' : row.ErrStatus == '3' ? 'color:rgb(255,0,255);' : row.ErrStatus == '4' or row.ErrStatus == '9' ? 'color:rgb(255,0,0);' : row.ErrStatus == '2' ? 'color:rgb(205,0,0);' : ''}
{code}
regards,
Branislav
Similar Messages
-
Performance operations based on Column values in SQL server 2008
Hi ,
I have a table which consist of following columns
ID Formula
Values
DisplayValue
1
a*b/100 100*12/100
null
2
b*c/100
12*4/100
null
I want to perform operation based on column "Values" and save data after operations in new column Name "Display Value" .i.e I want to get the below result . Can anyone please help.
ID Formula
Values
DisplayValue
1
a*b/100 100*12/100
12
2
b*c/100
12*4/100
0.48
Thanks for the help.
Regards, Priti ATry this,
create table #mytable (ID int,Formula varchar(10), [Values] varchar(10), DisplayValue decimal(10,4))
insert into #mytable values(1 ,'a*b/100','100*12/100',null)
insert into #mytable values(2 ,'b*c/100','12*4/100',null)
declare @rowcount int=1
while @rowcount <= (select max(id) from #mytable)
begin
declare @expression nvarchar(max)
select @expression=[values] from #mytable where id = + @rowcount
declare @sql nvarchar(max)
set @sql = 'select @result = ' + @expression
declare @result decimal(10,4)
exec sp_executesql @sql, N'@result decimal(10,4) output', @result = @result out
update #mytable set DisplayValue= @result where id = @rowcount
set @rowcount=@rowcount+1
end
select * from #mytable
Regards, RSingh -
Change the row colors based on column values in MOSS 2007.
Hi Team,
I am using MOSS 2007 environment. In that I am having one SharePoint list. In that list based on column values rows colors need to change.
Kindly help me anyone on this.
Thanks,
AshokHi Ashok,
Please follow the below link:
http://www.contentmaster.com/sharepoint-2010/conditional-formatting-of-list-views-for-sharepoint-2010-changing-the-font-colour/
http://sharepoint.stackexchange.com/questions/7478/highlight-row-color-based-on-field-values-in-sharepoint-2010-list-view
Best Regards,
Brij K -
SSRS - Expression to color column value dynamically in Matrix
Hi ,
I have a matrix which looks like :
The <<Expr>> value can be 1 /0 /"-" .
The Expr value is being calculated dynamically.
The data set query I am using has a column called due_days.
In the color expression of the <<Exp>> box I am using the expression as :
=IIf(Fields!Due_Days.Value>14 and Fields!Notes_Count.Value>0,"Blue",(Iif(Sum(Fields!Notes_Count.Value)=0 ,"Red","Black")))
My requirement is if the Due_Days column value is >14 then I need to highlight the value as blue else black and if value is 0 then red. When I use the above query it is just highlighting the color blue for 1st column only. Eg: 4th row . Due days for month
of Oct and Nov is > 14 but it shows blue only for month of oct.
How can i resolve the issue?In select query i have 5 columns:
Due days(Which is difference between 2 dates) ,
Notes count (Which is just a count of notes entered or not having value 0/1 and value '-' if another column CRD is greater than the matrix month and year.)Eg: below date 11/12/2014 is greater than Oct 2014 hence Oct 2014 should have "-"
Month Name , Year , Month Nbr (last 6 months which I cross joined with the table to get counts for each month)
The matrix has year and last 6 month as column groups
Color coding should be if notes count is 0 then red ,if notes count is 1 and due_days> 14 then blue else black . When i try to use expression for color as i mentioned above, it colors only 1st colum.eg: 2nd row
Nov 2014 is blue but for jan 2014 also it should show blue as due days>14 .
Is there any way i can do that ??
Eg: data set returns value as :
Due Days CRD Month
Month_Nbr Year Notes _Count
5 2014-11-28 00:00:00.000 December 12 2014
0
5 2014-11-28 00:00:00.000 February 2 2015
0
5 2014-11-28 00:00:00.000 January 1 2015
0
5 2014-11-28 00:00:00.000 November 11 2014 1
5 2014-11-28 00:00:00.000 October 10 2014 0
5 2014-11-28 00:00:00.000 September 9 2014 0
Matrix is of the form :
YEAR
MONTH
CRD Notes_count -
Workflow changing the status based some columns value
OOB workflow SP designer 2013
The workflow purpose is change the status columns from
COMPLETE to IN PROGRESS or from
IN PROGRESS to COMPLETE according some columns value.. And if the change is from
IN PROGRESS to COMPLETE
there will be change in some columns like
If alertSOP Date <= today then change the status (Columns value) from Complete to In Progress and send email to the manager (the manager email address is a column (Manager Email)
Else pause until the alert date=Today()
If the status (columns) = in progress send Remainder email every 10 days
If the status change from in progress to
Complete (BY MANAGER MANUALLY) then
last renewed Date =TODAY()
Valid to Review=TODAY() + 4 MONTH
Alert Date=today() + 5 month
and Due Date=today() + 6 months
AND START THE WORKFLOW AFTER UPDATING THIS COLUMNS FOR NEXT cycle
SharePoint List(http://server/site/..) LIST ITEMS
Department
Contractor
Division
Manager Email
Contractor last renewed Date
Contractor Valid to Review
Alert SOPReview
DueDate Review
Status
Workflow Status
ABC
JONAH
10
[email protected]
01/01/2014
05/06/2014
5/07/2014
5/08/2014
COMPLETE
paused
DEF
SMITH
20
[email protected]
01/01/2014
02/03/2014
2/28/2014
3/20/2014
INPROGRESS
INPROGRESS
Note:
The status is changed manually by manager from IN PROGRESS TO COMPLETE
The status from COMPLETE to IN PROGRESS is changed by event or Triggers (based the alert date)The First Part are coded as follow
(The workflow purpose is change the status columns from COMPLETE to IN
PROGRESS or fromIN PROGRESS to COMPLETE according
some columns value.. And if the change is from IN
PROGRESSto COMPLETE there
will be change in some columns like
If alertSOP Date <= today then change the status (Columns value) from Complete to In Progress and send email to the manager (the manager email address is a column (Manager Email)
Else pause until the alert date=Today()
If the status (columns) = in progress send
Reminder email every 10 days)
Note:
The first if Block work as expected
the second if block generate error.. Internal States Canceled
RequestorId: 3b262286-66e8-5f9f-09f8-3b09c5be0ebc. Details: System.ApplicationException: HTTP 400 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["1"],"SPClientServiceRequestDuration":["1997"],"SPRequestGuid":["3b262286-66e8-5f9f-09f8-3b09c5be0ebc"],"request-id":["3b262286-66e8-5f9f-09f8-3b09c5be0ebc"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
RequireReadOnly"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"Cache-Control":["max-age=0, private"],"Date":["Tue, 25 Mar 2014 21:25:35 GMT"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext
context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager
bookmarkManager, Location resultLocation) -
Inserting rows into table Based on Column Values.
Hi,
I am trying to inserting rows into a table based on Column.
Id Name
Data
N 105.1.1
http://www.example.com/New/105.1.1
U 105.1.2 http://www.example.com/Used/105.1.2
S 105.1.3 http://www.example.com/Sold/105.1.3
I want a table like this.
I want to insert Data column value based on Id and Name Columns
If Id = N and Name = 105.1.1 then Data value should be insert as http://www.example.com/New/105.1.1
If Id = U and Name = 105.1.2 then Data value should be insert as http://www.example.com/Used/105.1.2
If Id = S and Name = 105.1.3 then Data value should be insert as http://www.example.com/Sold/105.1.3
Can you please help us to write query to insert above Data Column values based on Id and Name Columns.INSERT INTO tbl (col) SELECT
CASE WHEN id='N' and Name='105.1.1 ' THEN 'http://www.example.com/New/105.1.1'
WHEN id='U' and Name='105.1.2 ' THEN 'http://www.example.com/New/105.1.2'
END col
FROM anothertbl
Sorry , cannot test it right now.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Link same column to different forms based on column value
Hi All
I have one report with column "STATUS" with values 'schedule' and 'Active'. I want to link this column to some forms based on these values if column value is 'schedule' then it will go to some other form or if value is 'Active ' then go to some other forms and also i want to send some parameters of particular column value so it will fetch data from table based on this status. how can i link same column to diffrent forms. please help me out.
ThanksHi,
In the report query you can conditionally generate the links.
Example.
select
case when status = 'schedule' then '<a href="'||'f?p=&APP_ID.:150:&SESSION.::NO:150:P150_ITEM1,P150_ITEM2:'||
value_for_item1||','||lvalue_for_item2||'">status </a>'
when status = 'active' then '<a href="'||'f?p=&APP_ID.:200:&SESSION.::NO:200:P200_ITEM1,P200_ITEM2:'||
value_for_item1||','||lvalue_for_item2||'">status </a>'
else status end column_title,
....Regards,
Natarajan
Edited by: Nattu on Mar 18, 2013 11:53 PM -
Display hperlink in report based on column values
Hi,
I have a requirement to make report column as hyperlink column with the condition that
1 . If report column values is 0 then on '0' hyperlink should not display.
2 . In other values hyperlink should display.
Please help me to achive this.
Thanks & Regards,
Priyaselect decode ( col1, 0, null, '{a href="f?p=&APP_ID.:XX:'||'&SESSION.'||'::::ID:'||col1||':YES" }Go{a}' as Link, col2, col3 from table
XX is your linked page number.
Replace { to <
and
} to > -
How to repeat rows based on column value
Hi all,
I have a query that gives me a result with a column value for example 4.
I now want to repeat this row 4 times with a new column that calculated from 1 - 4.
Or when column value is 3 I want to repeat row 3 times with new column name 1-3
Can anyone help me with this please? :)Hi Yvanlathem,
To achieve your requirement, you can reference the recursive approach as below.
DECLARE @T TABLE(Col1 CHAR(1),Col2 INT)
INSERT INTO @T VALUES('A',1),('B',2),('C',3)
;WITH Cte([Char],[Repeat]) AS
SELECT Col1,Col2 FROM @T
UNION ALL
SELECT [Char],[Repeat]-1 FROM Cte
WHERE [Repeat]>1
SELECT * FROM Cte ORDER BY [Char],[Repeat]
OPTION(MAXRECURSION 0)
/* Output
Char Repeat
A 1
B 1
B 2
C 1
C 2
C 3
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Problem with JDev 10g ADF table component and rangeChangeListener
Hi,
I'm populating an ADF table component from a backing bean and would like the range of rows be changed using custom method on the backing bean.
I have declared table on page as shown below and the table is populated correctly. However the onRangeChanged method in the backing bean never fires when
user hits previous or next. Any ideas of what I missed ?.
Thanks,
Kenneth
<af:table emptyText="No items were found"
value="#{companySearchBean.companies}"
var="company" rows="20"
first="#{companySearchBean.firstCompany}"
rendered="#{companySearchBean.queryExecuted}"
rangeChangeListener="#{companySearchBean.onRangeChanged}">
<af:column sortable="false" headerText="Company Name">
<af:outputText value="#{company.partyName}"/>
</af:column>
<af:column sortable="false" headerText="Party Number"
formatType="number">
<af:outputText value="#{company.partyFileNo}"/>
</af:column>
</af:table>Hi,
I'm populating an ADF table component from a backing bean and would like the range of rows be changed using custom method on the backing bean.
I have declared table on page as shown below and the table is populated correctly. However the onRangeChanged method in the backing bean never fires when
user hits previous or next. Any ideas of what I missed ?.
Thanks,
Kenneth
<af:table emptyText="No items were found"
value="#{companySearchBean.companies}"
var="company" rows="20"
first="#{companySearchBean.firstCompany}"
rendered="#{companySearchBean.queryExecuted}"
rangeChangeListener="#{companySearchBean.onRangeChanged}">
<af:column sortable="false" headerText="Company Name">
<af:outputText value="#{company.partyName}"/>
</af:column>
<af:column sortable="false" headerText="Party Number"
formatType="number">
<af:outputText value="#{company.partyFileNo}"/>
</af:column>
</af:table> -
ADF Table: sum of column value
Hi Experts,
I have a editable table which is having "Quantity of Volume" column.When user ll input the value in to this,Then the lower panel should show the sum of Volume. How I ll do this? Below is my table src code:
<af:table value="#{bindings.NominatedAllocationType2.collectionModel}"
var="row" rows="#{bindings.NominatedAllocationType2.rangeSize}"
emptyText="#{bindings.NominatedAllocationType2.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.NominatedAllocationType2.rangeSize}"
rowBandingInterval="0" id="t2">
<af:column sortProperty="TheQuantityOfVolume" sortable="false"
headerText="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.label}"
id="c6">
<af:inputText value="#{row.Volume.bindings.TheQuantityOfVolume.inputValue}"
label="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.label}"
required="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.mandatory}"
columns="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.displayWidth}"
maximumLength="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.precision}"
shortDesc="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.tooltip}"
id="it1">
<f:validator binding="#{row.Volume.bindings.TheQuantityOfVolume.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.NominatedAllocationType2.hints.Volume.TheQuantityOfVolume.format}"/>
</af:inputText>
</af:column>
</af:table>
Thanx
AswiniHi.
Check
Calculate Sum in VO issue again
http://technology.amis.nl/blog/1295/creating-a-dynamic-ajax-column-footer-summary-in-a-table-component-using-adf-faces -
Insert rows based on column value
I have customer_ no., Date and no_months as columns. I need to insert in a new table the customer_no as many times as the value of no_months column. Meaning if customer_no is 001 and if months value is 3 then in the new table I want three rows having customer_no as 001 and the date. Any help is highly appreciated.
Something like this?
SQL> with t
2 as
3 (select 23 cust_no,3 mon from dual
4 union all
5 select 10,9 from dual
6 union all
7 select 5,12 from dual
8 union all
9 select 7,1 from dual
10 )
11 select cust_no,mon
12 from
13 (
14 select cust_no,mon,row_number() over(partition by cust_no order by cust_no) rn from t,dba_tables
15 )
16 where rn<=mon
17 /
CUST_NO MON
5 12
5 12
5 12
5 12
5 12
5 12
5 12
5 12
5 12
5 12
5 12
CUST_NO MON
5 12
7 1
10 9
10 9
10 9
10 9
10 9
10 9
10 9
10 9
10 9
CUST_NO MON
23 3
23 3
23 3
25 rows selected.
SQL> -
Change source (sql) of interactive report based on column value?
I've got an Interactive report displaying 10 columns. What I'd like to do is show different columns depending on the value of the first column. All the rows in the result will have the same value in the first column.
If value in column 1 (on any row) = 'aaaa' then
display columns 1,2,3,4, 9, 10
If value in column 1 (on any row) = 'bbbb' then
display columns 1,2,3,4, 7, 8
If value in column 1 (on any row) = 'cccc' then
display columns 1,2,3,4, 5, 6
Should i somehow make the sql query dynamically change or can I use apex to dynamically hide the columns I don't want in the interactive report?
Appreciate if you could point me in the right direction...
/AHello Andy,
You can solve that in your SQL query:
select col1, col2, col3, col4
, case col1
when 'aaaa' then col9
when 'bbbb' then col7
when 'cccc' then col5
end newcol5
from tableYou may have to use to_char or to_number conversions when the datatypes of the col5,7 and 9 are different.
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
Combine rows based on column value
I'm trying to combine rows based off of a common value.
Table Data:
Result A
Player_ID Player_Name Team_Name Points Sequence
99999 John Smith Bulls 50 1
99999 John Smith Pistons 14 2
What i want in the output
Result B
Player_ID Player_Name Team_Name Points
99999 John Smith Bulls 64 (50 for Bulls)Here's my main query...
select player_id, player_name, team_name, points
from
SELECT player_id, player_name, team_name, sum(points) sum_points
FROM stats_data
WHERE season_id = 2008
AND points > 0
GROUP BY player_id, player_name, team_name
) t
ORDER BY sum_points DESC, last_name;**The current query gives me the output from Result A
1) Not entirely sure how to combine data based of player_id
2) Once i figure out 1, im sure by adding the ('sum_points' for 'team_name') to the output can be done with a case statement, i think?Sorry about that Frank.
Using: Oracle 10.2g
i was incorrect about the output of the query
SELECT player_id, sum(points) sum_points
FROM stats_data
WHERE season_id = 2008
AND points > 0
GROUP BY player_id
)Output
Player_ID Sum_Points
99999 20
55455 6
66489 2 So the subquery is outputing the correct data
The output of the original entire query(that you had posted) is:
Player_ID Player_Name Team_Name Points
99999 John Smith Bulls 16 (8 for Bulls)
55455 Bob Johnson Rockets 6 (3 for Rockets)
66489 Chris Terry Kings 2 (1 Kings)Here's some more raw sample data from the table:
Player_ID Player_Name Team_Name Points Sequence Game_Type_ID Team_ID
99999 John Smith Bulls 12 1 1 5
99999 John Smith Bulls 0 1 -1 5
99999 John Smith Pistons 4 2 1 12
99999 John Smith Pistons 0 2 -1 12
55455 Bob Johnson Rockets 4 1 1 3
55455 Bob Johnson Rockets 0 1 -1 3
66489 Chris Terry Kings 2 1 1 8
66489 Chris Terry Kings 0 1 -1 8So your code frank is very close, the issue is that:
A) All players have a ('pt value' for 'team name') even if they played on the same team, which can prob. be solved with a case statement, which i tried to do in my last post.
WITH grouped_data AS
SELECT player_id, sum(points) sum_points
FROM stats_data
WHERE season_id = 2008
AND points > 0
GROUP BY player_id
SELECT g.player_id
, s.player_name
, s.team_name
(case when sequence = 2 then g.sum_points <==
|| '('
|| TO_CHAR (s.points)
|| ' for '
|| s.team_name
|| ')'
else to_char (g.sum_points)
END) AS points
FROM grouped_data g
JOIN stats_data s ON g.player_id = s.player_id
WHERE s.sequence in (1,2) <==
AND s.season_id = 2008
AND s.points > 0;the output has two issues, for players who played on more than one team, like Josh Smith the output comes out as
99999 John Smith Pistons 20 (2 for Pistons)
99999 John Smith Bulls 20While the players who played on one team came out correctly. So issue with my edit of your code is:
A) josh smith is output 2, needs to be output once
B)josh smith should say (Josh Smith Bulls 20 (4 for Pistons) not "99999 John Smith Pistons 20 (2 for Pistons)"
c) Issues with "99999 John Smith Pistons 20 (2 for Pistons)" is that it listing the wrong team for him: should be Bulls and listing half of his total with the pistons in the prentices should be 4. --The reason that is because s.points needs to be summed as based off of the data there's two entries
Hope this clears it up, thanks!
Edited by: user652714 on Mar 11, 2009 9:28 AM -
How to generate page break based on column value
I am new to Reports. So please excuse me if it has been answered.
Please help me to generate a page break when the database table column is a cetain value.
Specifically, if the DAY of a reserv_date column is 'Monday' then I should generate a page break.
Thanks for your help.Hi,
Try this solution
SOLUTION EXPLANATION:
Go to the layout editor and add a horizontal line to the layout.
Place this line directly below the field that will be associated with the format trigger.
The line should also be within the repeating frame of the referenced column.
Apply line color to make the line white (so it won't show up in the printed report) and set the properties to Page Break Before.
Then add a format trigger on the line object to check the value of the desired
column.
For instance, if a master-detail report is created on the EMP table,
and a page break is desired whenever the value of the COMM field is not null,
create a trigger as follows:
function b_1Format trigger return boolean is
begin
if :comm is not null
then
return (true);
else return (false);
end if;
end;
When the report is run, a page break will occur whenever the value of COMM is
not null.
Thanks,
Oracle Reports Team
Maybe you are looking for
-
Hi, I have migrated my Sharepoint from 2010 to 2013.I am able to get the data at the first time of refresh when I click on refresh for the second time I am getting the empty the sheet. below find the flow of refresh First Refresh On Click of refresh
-
LSMW- Recording : Multiple Line Items
I am trying to create an LSMW recording that simulates transaction O3I7. The thing is that we have different line items. This is similar to a sales order where we have header details and items details. I created a recording. Then I created two struct
-
Sched. Collective Order
Experts, if I have a collective order one parent order (A) and three child orders (B,C,D). At order start the order start dates and finish dates are alligned. My question is, if I get a delay in child order B, should the parent order A automatically
-
Urgent: Please help: IE5 caching problem
Hi all, I've a web page created by a servlet. Everytime I run this page with different parameters, the prevoius page is getting cached. I've to manually refresh the browser to see the new page. This is happening only on IE5 browser. I've included the
-
Reinstalled Photoshop Elements 11 software HELP!
I reinstalled PSE 11 after my Macbook was wiped...its in my documents and looks to be loaded but no prompts on what to do next???Says 93.6MB ....is it fully installed I can't tell? HELP I've had it with installing things...took 3 days to update to M