将级联输入与JasperReports JasperServer 4.0的API/Web服务一起使用 [英] Using Cascading inputs with API/Web Services for JasperReports JasperServer 4.0

查看:49
本文介绍了将级联输入与JasperReports JasperServer 4.0的API/Web服务一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速序言.我的公司实际上是在为Jasper的支持付费,但是他们一直无法帮助我.在这一点上,谷歌搜索答案只能将我引到我自己站点上未解答的论坛话题.我要疯了.

Quick preface. My company is actually paying for Jasper support, but they have been unable to help me. At this point googling for the answer only leads me to my own unanswered forum threads on their site. I am going crazy.

我用Jasper的Web服务API编写代码来处理级联输入的时间真是太糟糕了.他们的Web服务示例Web应用程序无法处理此问题(即使此功能是自3.7以来他们一直在大量使用).我找到示例的唯一地方是其Web服务文档中的大约15行代码(64页pdf).但是,没有关于它在做什么的解释.

I am having a terrible time writing code to handle cascading inputs with Jasper's Web Services API. Their web services sample web app does not handle this (even though this feature is something they have been heavily pimping since 3.7). The only place where I have found an example is in about 15 lines of code from their Web Services documentation (a 64 page pdf). However there is no explanation as to what it is doing.

有人能实现吗?您可以举一个简单的例子,并提供一些逻辑上的解释吗?

Has anyone been able to implement this? Can you give a simple example, with some kind of logical explanation?

这是一个愚蠢的场景(可以随意组成自己的场景)

Here is a dumb scenario (feel free to make up your own)

我有一个包含2个输入inputA和inputB的报告,其中A的选择影响B所示的选择.因此inputA给我的选择是猫",狗",鸟".我决定为inputA选择"Dog".然后,inputB应该给我提供以下选项:贵宾犬",拉布拉多",穆特".

I have a report with 2 inputs inputA and inputB where the choice for A effects the choices shown for B. So inputA gives me the choices "Cat", "Dog", "Bird". I decide to pick "Dog" for inputA. inputB should then give me the options: "Poodle", "Labrador", "Mutt".

我如何选择inputA的"Dog"选项,并使用jasper Web服务找出inputB的那三个选项?

How can I take the "Dog" choice for inputA and use the jasper web services to figure out those 3 options for inputB?

我真的在寻找带有某种解释的代码示例.

I am really looking for code samples with some kind of explanation.

再说一次.我要疯了.

推荐答案

在ireport中,您可以创建输入控件. 右键单击将是您的第二个参数的输入控件,转到属性. 在属性->输入控件详细信息选项卡->编辑本地资源中 现在转到查询标签

In ireports you can create input controls. Go to properties by right clicking the input control that would be your 2nd parameter. In Properties->Input Control Details Tab->Edit Local Resource now go to the query tab

添加带有第一个选择框值作为参数的查询.此参数应在报表中的参数"部分声明.

Add a query with the first select box value as a parameter.This parameter should be declared in your report under the parameters section.

查询示例 select reqtitle,clientname from hc_requisitions inner join hc_clients on hc_clients.rid=hc_requisitions.clientid where clientname=$P{clientname}

Query for example select reqtitle,clientname from hc_requisitions inner join hc_clients on hc_clients.rid=hc_requisitions.clientid where clientname=$P{clientname}

其中$P{clientname}是第一个选择框中的值.

where $P{clientname} is the value from the first select box.

希望有帮助!

这篇关于将级联输入与JasperReports JasperServer 4.0的API/Web服务一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆