本文介绍了基于项目值的 Oracle Apex 19.x 外部 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Application Express 19.2.0.00.18 与 Oracle Database 12c 企业版 12.2.0.1.0 版一起使用.在我们的应用程序(从 4.x 开始)中,我们使用 Jaspersoft Reports 创建 PDF(发票、标签、运输文件等),我们使用 db 函数接收报告名称和页面项目值等参数并返回一个 html 标签关联.例如:

I'm using Application Express 19.2.0.00.18 with Oracle Database 12c Enterprise Edition Release 12.2.0.1.0.In our applications (from 4.x) we use Jaspersoft Reports to create PDFs (invoices, labels, shipping documents, etc.) and we use a db function that take in parameters like report name and page items values and returns an html tag for link. E.G.:

myFunction (myReportName, P01_ITEM_A ,P01_ITEM_B)
return
<a href="http://myjasperserver/rest/myReportName.pdf?x=itemAvalue&y=itemBvalue"><img scr="/imagespath/pdf.png"></a>

通过这种方式,可以在需要的地方渲染可点击的图像,以根据项目的实际值生成报告.这个解决方案在我们的 Apex 应用程序中被大量采用,但我们在 19.x 中尝试这样做时遇到了一些困难.我们需要一些帮助或建议,以便重现相同的功能或以不同的方式做同样的事情.

In this way it is possible to render where needed a clickable image to generate a report based on actual values of items. This solution is heavy adopted in our Apex applications but we are facing some difficulties trying to do the same in 19.x. We need some help or suggestions in order to reproduce the same feature or to do the same in a different way.

根据 Littlefoot 的建议,我可以指定困难"是:

As suggested by Littlefoot I can specify that "difficulties" are :

  • 在 Apex 4.x 中,查询:select someFieldList ,myFunction (myReportName, P01_ITEM_A ,P01_ITEM_B) PDF from dual 生成报告列 PDF 是可点击的图像(或文本,png 不是强制性的).在 Apex 19.x 中,相同的查询会生成一个报告,其中 PDF 列呈现为纯文本.
  • 在 Apex 4.x 中,如果我使用与 Display Only 项目的 Source 属性相同的查询,它会呈现为可点击的链接(文本或图像).在 Apex 19.x 中,仅显示"项始终不可点击.
  • In Apex 4.x the query : select someFieldList ,myFunction (myReportName, P01_ITEM_A ,P01_ITEM_B) PDF from dual results in a report with the column PDF that is a clickable image (or text, the png is not mandatory). In Apex 19.x the same query results in a report with the column PDF rendered as Plain Text.
  • In Apex 4.x if I use the same query as Source attribute of a Display Only item it is rendered as a clickable link (text or image). In Apex 19.x the Display Only item is always not clickable.

推荐答案

这两个问题的解决方案是一样的.APEX 19.2 比 APEX 4.x 先进很多,默认情况下更安全.对于纯文本报告列和仅显示页面项目,默认安全设置为转义特殊字符":

The solution to both issues is the same. APEX 19.2 is a lot more advanced than APEX 4.x, and by default is more secure. For both Plain Text report columns and Display Only page items the default security setting is "Escape special characters":

这特意转义了内容中的任何 HTML 标签,以避免潜在的 XSS(跨站点脚本)安全风险.

This deliberately escapes any HTML tags in the contents to avoid potential XSS (cross-site scripting) security risks.

只需取消选择此设置,您的链接将再次显示为链接.

Simply unselect this setting and your links will appear as links again.

这篇关于基于项目值的 Oracle Apex 19.x 外部 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:43