【问题标题】:how acess the report column value in oracle-apex?如何访问 oracle-apex 中的报告列值?
【发布时间】:2018-01-27 03:22:41
【问题描述】:

我需要仅当“stato prenotazione”列为“IN SOSPESO”时才显示“elabora prenotazione”按钮 我试图设置一个条件,但我不知道如何选择列值

【问题讨论】:

  • Ivano,请阅读stackoverflow.com/help/mcve,以便我们了解我尝试了哪些方法来帮助您。
  • 您是指链接“elabora prenotazione”吗?

标签: oracle oracle11g oracle-apex


【解决方案1】:

如果我理解您的问题,这可能会有所帮助:

报告来源:

SELECT
    CASE
        WHEN stato_prenotazione = 'in sospeso' THEN 'elabora prenotazione'
        ELSE ''
    END name_of_column,
prenotazione,
username,
nome,
cognome,
viaggio,
stato_viaggio,
data_prenota,
stato_prenotazione,
numero_ospiti
FROM your_table

然后将“name_of_column”列设置为type:link,并填写target。

【讨论】:

    【解决方案2】:

    在您的 SQL 中围绕对 apex_page.get_url 的调用包装一个条件,这样它只会在相关时生成一个链接

    使用的函数示例,无条件: https://azureoutput.wordpress.com/2017/10/18/custom-hyperlink-in-interactive-report/

    使用它可以使按钮看起来更漂亮,也许还有其他想法 https://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html

    请参阅有关转义特殊字符的内容,否则您只会在报告中看到 HTML https://www.grassroots-oracle.com/2017/01/escape-special-characters-apex-demo.html

    【讨论】:

      【解决方案3】:

      这可以通过@sara 提到的简单 case 语句来解决。 类似:

      select (case stato_prenotazione when 'in sospeso' then 'elabora prenotazione' end) as your_column

      我不会保留 else 条件,因此如果不满足条件,该列将仅包含空值。

      【讨论】:

        猜你喜欢
        • 2012-10-27
        • 1970-01-01
        • 1970-01-01
        • 2016-12-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多