【问题标题】:JasperReports Server does not execute a query that iReport doesJasperReports 服务器不执行 iReport 执行的查询
【发布时间】:2013-07-14 16:28:01
【问题描述】:

我正在使用 JasperReports 4.7iReport 4.7.1PostgreSQL 8.4 作为数据库后端。

在使用类似于

的查询进行报告时
(select * from table1)
union
(select * from table1)

我发现 iReport 确实报告了,但是当我将报告上传到 JasperReport 服务器时,我得到了An error has occurred. Please contact your system administrator. (6632)

我将查询重写为

select *
from (
(select * from table1)
union
(select * from table1)
) t

它适用于 iReportJasperReports

所以,问题是,我是遗漏了什么还是需要配置什么?

【问题讨论】:

  • 出于好奇,如果将原始查询中的 UNION 更改为 UNION ALL 会发生什么?
  • 当然,由于重复的元组,两个查询的结果都会发生变化,但问题仍然存在。第一个查询不在 JasperReports 上运行。
  • Postgres 数据库是您的存储库还是您的数据源?

标签: jasper-reports jasperserver


【解决方案1】:

我认为这是因为“新”(自 4.5 版起)安全功能。 SQL 查询在服务器上执行时应以 select 开头。 (您的查询以“(”)开头 尝试禁用安全检查,用于测试:

security.validation.sql.on=false

在:

webapps/jasperserver/WEB-INF/classes/esapi/security-config.properties

【讨论】:

  • 谢谢@robin.koch。没错,这是因为验证安全功能。
猜你喜欢
  • 2017-05-16
  • 1970-01-01
  • 2020-02-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多