Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Having two rows corresponding to one result in a portlet?

Highlighted
vamsee_1
Regular Collector

Having two rows corresponding to one result in a portlet?

Hi,

We have a requirement wherein a portlet should display data relevant to a single row resultset in 2 rows.

For example first row would have
name project-id status
and the second row would have comments for the same request id.
3 REPLIES
Erik Cole
Honored Contributor

Re: Having two rows corresponding to one result in a portlet?

Select name project-id status
Where request_id = [something]
UNION
Select comment from.....
Where request_id = [something]

?
vamsee_1
Regular Collector

Re: Having two rows corresponding to one result in a portlet?

Will that create 2 rows in the portlet??? Could you please let me know how do we create this portlet?
Tim Brandish
Frequent Visitor

Re: Having two rows corresponding to one result in a portlet?

Something like this should be your data source:

SELECT utable.i ID_COLUMN, utable.a COLUMN_A, utable.b COLUMN_B, utable.c COLUMN_C
FROM (select p.PFM_REQUEST_ID i, p.PROJECT_NAME a, to_char(p.PROJECT_ID) b, p.DISPLAY_STATUS c
from pm_projects p
union
select p.PFM_REQUEST_ID i, p.DESCRIPTION a, '' b, '' c
from pm_projects p
order by i) utable
WHERE 1=1

Make sure that you disable sorting for columns other than the ID. See the attached pdf for my example.
//Add this to "OnDomLoad" event