Reputation: 560
I create a page and add an interactive report to show data of view
CREATE OR REPLACE VIEW FAC_FILE_MANAGEMENT_VIEW AS
SELECT FAC_FILE.NAME as FILE_NAME, FAC_NHAN_VIEN.USERNAME as USERNAME,
FAC_FILE_MANAGEMENT.FAC_MONTH as FAC_MONTH, FAC_FILE_MANAGEMENT.FAC_YEAR as FAC_YEAR, FAC_FILE_UPLOAD.LAST_UPDATED as LAST_UPDATED,
CASE IS_COMPLETED
WHEN 0 THEN 'Not Upload'
WHEN 1 THEN 'Completed'
END as IS_COMPLETED
FROM FAC_FILE_MANAGEMENT left join FAC_FILE on FAC_FILE_MANAGEMENT.FILE_ID = FAC_FILE.ID
left join FAC_FILE_UPLOAD on FAC_FILE_MANAGEMENT.FILE_UPLOAD_ID = FAC_FILE_UPLOAD.ID
left join FAC_NHAN_VIEN on FAC_FILE_MANAGEMENT.UPLOADED_BY = FAC_NHAN_VIEN.ID;
Now, I want to create new custom column nam 'View Detail'. This column is a link based on value of IS_COMPLETED
How can I add a custom column into interactive report?
Upvotes: 3
Views: 11728
Reputation: 1478
Its much easier if you just add NULL to the query like this
SELECT NULL as View_Detail, <insert other columns>
FROM TABLE
Upvotes: 4
Reputation: 2827
add column to your report query like:
,DECODE(IS_COMPLETED,'Y','<a href="f?p=&APP_ID.:1:&SESSION.::::P1_FILE_NAME:' || FAC_FILE.NAME ||'">View Detail</a>','N','') AS 'Detail'
This will add new column to your report.
Now go to your Report Attributes
tab and edit Detail
Column.
and change Display As
to Standard Report Column
.
Also, you need to select column in interactive report to display from your output.
Upvotes: 2