Oracle Apex:将自定义列添加到交互式报告中

时间:2015-09-22 11:09:32

标签: database oracle report oracle-apex

我创建了一个页面并添加了一个交互式报告来显示视图数据

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;

现在,我想创建新的自定义列nam'查看详细信息'。此列是基于IS_COMPLETED

值的链接
  • 已完成:显示查看详细信息的链接
  • 不上传:空白

如何在交互式报告中添加自定义列?

2 个答案:

答案 0 :(得分:1)

在报告查询中添加列,例如:

struct s { int a; };
struct s; // does nothing (s already defined in this scope)
void g() {
    struct s; // forward declaration of a new, local struct "s"
              // this hides global struct s until the end of this block
    s* p;     // pointer to local struct s
    struct s { char* p; }; // definitions of the local struct s
}

这会在报告中添加新列。

现在转到,DECODE(IS_COMPLETED,'Y','<a href="f?p=&APP_ID.:1:&SESSION.::::P1_FILE_NAME:' || FAC_FILE.NAME ||'">View Detail</a>','N','') AS 'Detail' 标签,然后修改Report Attributes列。

并将Detail更改为Display As

此外,您需要在交互式报告中选择要从输出中显示的列。

答案 1 :(得分:0)

如果你只是像这样添加NULL

,那就容易多了
SELECT NULL as View_Detail, <insert other columns>
FROM TABLE