主题:如何跨多个环境部署带有子报表的 Pentaho 报表
我正在尝试创建可以在不同环境(测试、生产)和/或不同数据库中部署的报告,而无需更改 prpt 文件。
因此,我创建了一些 jndis,并将 jndi 名称作为参数传递给 xaction,xaction 依次执行查询并将结果传递给 prpt。效果很好。
直到我开始使用子报表。
我认为没有办法将主报告每一行的结果集传递给子报告。
似乎如果您使用子报表,则必须在子报表内定义连接和查询。
我错了吗?有人试过这个吗?部署带有子报表的多租户报表并将连接或 jndi 作为参数传递的“正确”方法是什么? (如果有其他方法,我愿意放弃使用 jndi)
谢谢!
更新:biserver 3.7 和 3.7 中存在与此相关的错误。 3.8 链接
I'm trying to create reports that I could deploy in different environments (test, production) and/or with different databases, without changing the prpt file.
So, I created some jndis, and pased the jndi name as a parameter to a xaction that in turn executed the query and passed the result to the prpt. It worked great.
Until I started using subreports.
I think there's no way to pass a result set to a subreport for each line of the main report.
It seems that If you use subreports, you have to define the connection and the query inside the subreport.
Am I wrong? Has anyone tried this? What's the "proper" way to deploy a multi-tenant report with subreports, and pass the connection or jndi as a parameter?
(I'm open to drop the use of jndi if there's another way)
Thanks!
Update: There's a bug related to this in biserver 3.7 & 3.8 link
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,可以在父报告中定义连接。只需确保在子报表本身的查询名称设置中指定它即可。
nope, the connection can be defined in the parent report. just make sure you specify it in the Query name setting of the subreport itself.
XActions 在报告引擎有机会实际使用所有数据集之前预先计算它们。外部数据集是预先计算的,没有关于子报表的任何信息,因此它将失败(除非您使用一些丑陋的技巧来使用计算的查询名称作为预先计算的表模型的查找键)。
为什么不像其他人一样使用 JNDI? JDNI 旨在将连接信息抽象为逻辑名称。连接是在报表外部定义的,报表仅引用名称。
阅读我的博客文章,了解更多内容:“不要硬编码主机名,使用 JDNI”(这可能描述了问题的核心;))。
XActions precompute all datasets before the reporting engine has a chance to actually work with them. External datasets are precomputed without any information on your subreports, and therefore it will fail (unless you use several ugly tricks to use a calculated query-name as a lookup-key into the precomputed table-models).
Why don't you use JNDI, like everyone else? JDNI was designed to abstract connection information into a logical name. The connection is defined outside of the report, and the report just references the name.
Read more on my blog post named: "Dont hardcode host names, use JDNI" (which probably describes the core of your problem ;) ).