简体   繁体   English

如何在oracle-apex中访问报表列值?

[英]how acess the report column value in oracle-apex?

I need the "elabora prenotazione" button to be shown only when the column "stato prenotazione" is "IN SOSPESO" I tried to set a condition but I don't know how to pick the column value 我仅在列“ stato prenotazione”列为“ IN SOSPESO”时才需要显示“ elabora prenotazione”按钮,但我尝试设置条件,但我不知道如何选择列值

在此处输入图片说明

If I understand your question, this could help: 如果我理解您的问题,这可能会有所帮助:

For the source of your report: 有关报告的来源:

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

Then set the column "name_of_column" to type: link, and fill the target. 然后将“ name_of_column”列设置为:link,并填充目标。

Wrap a condition around a call to apex_page.get_url within your SQL, so it will only produce a link when relevant 在SQL中围绕对apex_page.get_url的调用包装条件,因此仅在相关时才会产生链接

Example of function in use, sans condition: https://azureoutput.wordpress.com/2017/10/18/custom-hyperlink-in-interactive-report/ 使用的功能示例,无条件: https : //azureoutput.wordpress.com/2017/10/18/custom-hyperlink-in-interactive-report/

Use this to make the button look prettier, and maybe get some other ideas https://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html 使用它可以使按钮看起来更漂亮,并可能获得其他一些想法https://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html

See this in regard to escaping special characters, otherwise you'll just see HTML in your report https://www.grassroots-oracle.com/2017/01/escape-special-characters-apex-demo.html 请参阅有关转义特殊字符的说明,否则,您将在报告中仅看到HTML https://www.grassroots-oracle.com/2017/01/escape-special-characters-apex-demo.html

This could be resolved by a simple case statement as @sara mentioned. 这可以通过一个简单的案例声明来解决,如@sara所述。 something like: 就像是:

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

I would not keep else condition so that the column will simply contain null value if the condition is not met. 我不会保留其他条件,以便如果不满足条件,则该列将仅包含空值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM