如何在 Apex 中基于视图/表格创建报表/表单页面组合?

发布于 2024-12-14 14:42:36 字数 113 浏览 3 评论 0原文

是否可能,如果可以,那么如何创建两个页面(一份报告,一份编辑表单),但将报告基于视图,并将编辑表单基于表格?

我有一个非常复杂的视图,无法更新,所以我需要让编辑表单基于表中的原始数据。这怎么可能?

Is it possible, and if so, then how to create two pages (one report, one edit form), but base the report on a view, and base the edit form on a table?

I have a very complex view, which is not update-able, so I would need to have the edit form be based on raw data from the tables. How is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

调妓 2024-12-21 14:42:36

首先,您需要创建报告,并基于您的表格。
然后创建您的表单。

要将它们链接起来,您需要知道表单所基于的表的主键。我假设您的表有一个由 1 或 2 列组成的 PK,并且您的自动行获取 + DML 流程使用此 PK。
PK 形式
这是因为 PK 值形成了报告中的行和表单中的行之间的链接。

然后,在报告属性中,找到“链接列”部分 - 或者,如果您想使用报告中的列作为链接​​,则转到该列的选项,并在那里找到“链接列”部分。该链接必须是“链接到自定义目标”。选择一个图标或定义链接文本。
报告属性上的链接意味着您必须在单行列图标或自定义链接之间进行选择。如果链接已存在,请在报表查询中创建一个新的空列,并在该列中配置链接。
链接列属性

Settings:
Target: Page in this Application
Page: the page number of your form
Clear Cache: page number of your form

然后传递唯一标识表中用于表单(您的 pk)的行的值。
示例:

Item 1: Name: "P2_EMPNO" Value: "#EMPNO#"

这就是它的要点,也是当您使用带有报表的表单的向导时生成表单和报表之间的链接的方式。

情况比较复杂?
例如,您的 PK 超过 2 列。在 Apex 4.1 中,您可以根据表的 rowid 进行自动行获取和 dml(救星)。在这种情况下,您可以考虑在视图中包含表记录的rowid(当然它需要在您的视图中使用别名)。然后,您可以将此 rowid 传递给表单页面上包含该 rowid 的项目。

4.1 上不行,或者 rowid 不是一个选项,并且 PK 超过 2 列:您将需要编写自己的行获取和 dml 过程,或者使用替代触发器创建视图。我认为更好的做法是创建表的视图,并将 PK 列连接到视图的列中。然后,此列可以充当 apex 生成过程中的 PK 值。无论哪种方式,您都需要想出一种方法来识别行,并提供在表单页面上获取和处理的正确方法。请参阅此问题了解更多信息< /a>.

First you need to create your report, and base it on your table.
Then create your form.

To link them up you will need to know the primary key of the table your form is based on. I will be assuming your table has a PK consisting of 1 or 2 columns, and your automated row fetch + DML process uses this PK.
PK in form
This is because the PK values form the link between the row in the report and the row in the form.

In your report attributes, you then locate the Link Column section - or if you want to use a column in your report as a link, then go to the options for the column, and locate the Link Column section there. The link has to be a "Link to custom target". Choose an icon or define the link text.
The link on the report attribute will mean you have to choose between single row column icon or a custom link. If a link is already in place, create a new null column in your report query, and configure the link in that column.
Link column attributes

Settings:
Target: Page in this Application
Page: the page number of your form
Clear Cache: page number of your form

Then you pass along the values that uniquely identify a row in the table used for your form (your pk).
Example:

Item 1: Name: "P2_EMPNO" Value: "#EMPNO#"

That's the gist of it, and is also how the link between a form and report is generated when you'd use the wizard for a form with a report.

More complex situation?
For example, your PK has more than 2 columns. In Apex 4.1 you can base the automated row fetch and dml on the rowid of your table (a lifesaver). In this case you can consider to include the rowid of record of the table in the view (it needs to be aliased in your view of course). You can then pass this rowid to the item containing the rowid on your form page.

Not on 4.1, or rowid is not an option, and the PK has more than 2 columns: you will need to write your own row fetch and dml process or make a view with an instead-of trigger. I consider it a better practice to make a view of your table, and concatenate the PK columns into a column for your view. This column can then acts as your PK value in the apex generated processes. Either way, you need to come up with a way to identify a row, and provide the right way of fetching and processing on the form page. See this question for some more info.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文