英文:
How to call groupBy actions on Interactive Grid/Interactive Reports with JavaScript Dynamic Action in Oracle APEX?
问题
我正在使用Oracle APEX 23.1.0版本,我有一个交互式网格/交互式报表区域。我想要创建一个按钮,通过预定的列COL1
和COL2
对数据进行分组,并统计每个组中的行数。问题是我想使用JavaScript动态操作来完成所有这些,触发条件是我放置的某个按钮被点击。
我在文档中没有找到任何关于如何查找可能的操作或如何执行它们的信息。这可能吗?
英文:
I am using Oracle APEX 23.1.0, and I have an interactive grid/interactive report region. I want to make a button that groups the data by some predetermined columns COL1
and COL2
, and count the number of rows in each group. The problem is that I want to do all this with a JavaScript dynamic action that is triggered when some button I placed is clicked.
I have not been able to find any information in the documentation on how to find the possible actions or how to execute them. Is this possible?
答案1
得分: 1
以下是要翻译的内容:
为了简化起见,让我们以一个交互式报告为例。我尚未测试过此方法是否适用于只读交互式网格。
这些是步骤:
- 创建一个使用函数 APEX_REGION.OPEN_QUERY_CONTEXT 来检索交互式报告执行的最后一个查询的管道函数。
- 循环遍历结果集并将组名/组计数存储在PL/SQL记录表中。
- 然后循环遍历记录表,并将组名/计数传送到管道中。
- 在您的动态操作中,您将能够从管道函数中进行选择。
您没有提到您想要对结果进行什么操作,因此无法提供更多信息。有关如何使用 APEX_REGION.OPEN_QUERY_CONTEXT 的示例,请参阅此博客。
英文:
For the sake of simplicity, lets take an interactive report. I have not tested this approach for a read only interactive grid.
These are the steps:
- Create a pipelined function that uses the function APEX_REGION.OPEN_QUERY_CONTEXT to retrieve the last query executed for the interactive report.
- Loop through the result set and store the group names / group count in a pl/sql table of records.
- Then loop through the table of records and pipe the group name / count
- in your dynamic action you'll be able to select from the pipelined function.
You have not mentioned what you want to do with the results so can't really tell you more. For an example on how to use a APEX_REGION.OPEN_QUERY_CONTEXT, check this blog.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论