简体   繁体   English

在 Oracle Apex 如何根据列值设置报表分页?

[英]In Oracle Apex how to you set pagination for a report based on a column value?

I have this table with a column of type Date called "Creation_Date" that contains the creation date for each row:我有一个名为“Creation_Date”的日期类型列,其中包含每一行的创建日期:

+--------------+--------------+---------------+
| TaskName     | Validated_By | Creation_Date |
+--------------+--------------+---------------+
| Task A       | Jim          | 12/1/2022     |
| Task B       | John         | 12/1/2022     |
| Task C       | Jill         | 12/1/2022     |
| Task D       | John         | 11/30/2022    |
| Task E       | John         | 11/30/2022    |
| Task F       | Bill         | 11/30/2022    |
| Task G       | Goerge       | 11/29/2022    |
| Task H       | George       | 11/29/2022    |
+--------------+--------------+---------------+

I want a classic report for this table in Oracle Apex to appear to the user like this:我希望 Oracle Apex 中此表的经典报告向用户显示如下:

12/1/2022 >
+--------------+--------------+
| TaskName     | Validated_By |
+--------------+--------------+
| Task A       | Jim          |
| Task B       | John         |
| Task C       | Jill         |
+--------------+--------------+

And when they click on the arrow next to the date the rows for the previous day show up:当他们点击日期旁边的箭头时,前一天的行就会出现:

< 11/30/2022 >
+--------------+--------------+
| TaskName     | Validated_By |
+--------------+--------------+
| Task D       | John         |
| Task E       | John         |
| Task F       | Bill         |
+--------------+--------------+

And when they press again, the rows for the day before that show up, etc:当他们再次按下时,前一天的行会出现,等等:

< 11/29/2022 >
+--------------+--------------+
| TaskName     | Validated_By |
+--------------+--------------+
| Task G       | Goerge       |
| Task H       | George       |
+--------------+--------------+

Is there a built-in way in Oracle Apex to do this for a Classic Report (or for an Interactive Report, doesn't matter)? Oracle Apex 中是否有内置方法可以为经典报告(或交互式报告,无关紧要)执行此操作?

As @Scott statet, nothing built in but this shouldn't be that hard to code (for classic report/interactive report).作为@Scott statet,没有内置任何内容,但这应该不难编码(对于经典报告/交互式报告)。 Make sure you have an item P1_DATE that holds the date for which the rows are shown.确保您有一个项目P1_DATE ,其中包含显示行的日期。

--- create test data
CREATE TABLE test_data (task, name, dt) AS 
(

SELECT 'Task A','Jim',    TO_DATE('12/1/2022','MM/DD/YYYY') FROM DUAL UNION ALL     
SELECT 'Task B','John',   TO_DATE('12/1/2022','MM/DD/YYYY') FROM DUAL UNION ALL     
SELECT 'Task C','Jill',   TO_DATE('12/1/2022','MM/DD/YYYY') FROM DUAL UNION ALL     
SELECT 'Task D','John',   TO_DATE('11/30/2022','MM/DD/YYYY') FROM DUAL UNION ALL    
SELECT 'Task E','John',   TO_DATE('11/30/2022','MM/DD/YYYY') FROM DUAL UNION ALL    
SELECT 'Task F','Bill',   TO_DATE('11/30/2022','MM/DD/YYYY') FROM DUAL UNION ALL    
SELECT 'Task G','Goerge', TO_DATE('11/29/2022','MM/DD/YYYY') FROM DUAL UNION ALL    
SELECT 'Task H','George', TO_DATE('11/29/2022','MM/DD/YYYY') FROM DUAL 
);
Report报告

Report source would be:报告来源将是:

SELECT task, name, dt FROM test_data WHERE dt = TO_DATE(:P1_DATE,'MM/DD/YYYY');
Previous button configuration:以前的按钮配置:
  • Page Item P1_DATE_PREV .页面项目P1_DATE_PREV
  • Source:资源:
SELECT MAX(dt) FROM  test_data WHERE dt < TO_DATE(:P1_DATE,'MM/DD/YYYY');
  • To hide button if there is no previous date: Add Server side condition of "rows returned"如果没有以前的日期,则隐藏按钮:添加“返回的行”的服务器端条件
SELECT 1 FROM  test_data WHERE dt < TO_DATE(:P1_DATE,'MM/DD/YYYY');
  • The "previous" button would redirect to Page 1 and set P1_PAGE to P1_PAGE_PREV “上一页”按钮将重定向到第 1 页并将P1_PAGE设置为P1_PAGE_PREV
Next button configuration:下一步按钮配置:
  • Page Item P1_DATE_NEXT .页面项目P1_DATE_NEXT
  • Source:资源:
SELECT MIN(dt) FROM  test_data WHERE dt > TO_DATE(:P1_DATE,'MM/DD/YYYY');
  • To hide button if there is no next date: Add Server side condition of "rows returned"如果没有下一个日期,则隐藏按钮:添加“返回的行”的服务器端条件
SELECT 1 FROM  test_data WHERE dt > TO_DATE(:P1_DATE,'MM/DD/YYYY');
  • The "next" button would redirect to Page 1 and set P1_PAGE to P1_PAGE_NEXT “下一步”按钮将重定向到第 1 页并将P1_PAGE设置为P1_PAGE_NEXT

暂无
暂无

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

相关问题 如何在oracle-apex中访问报表列值? - how acess the report column value in oracle-apex? Oracle Apex - 经典报告 - 将列值设置为单独 SQL 查询的结果,将列值传递给查询 - Oracle Apex - Classic Report - Set Column Value to the result of a separate SQL query, passing the column value to the query Oracle Apex 5.1:基于LOV(值列表)的报告列显示返回值而不显示值 - Oracle Apex 5.1: Report column based on LOV(List of values) showing returned value not display value Oracle Apex 5如何根据单元格值更改经典报表中的单元格颜色 - Oracle Apex 5 how to change cell color in classic report based on cell value Oracle Apex 4.2交互式报表列值截断 - Oracle Apex 4.2 Interactive Report Column Value Truncation Apex oracle 是否可以在 sql 查询中使用列值进行交互式报告? - Apex oracle is it possible to use a column value in sql query for interactive report? 如何从Oracle Apex的不同列属性页面引用列的值? - How do you reference value of column from a different column attributes page in Oracle Apex? 如何根据 Oracle Apex 中其他列的值启用或禁用列中的按钮? - How to Enable or Disable button in a column based on other column's value in Oracle Apex? 如何在 Oracle Apex 5 中改变交互式报表列的宽度 - How to Vary the width of Interactive Report Column in Oracle Apex 5 如何在 oracle Apex 的交互式报表中将行数设置为 5 - How to set number of rows to 5 in interactive report in oracle Apex
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM