在iReport中加载包含参数的promt框 [英] Loading promt box with parameters in iReport

查看:230
本文介绍了在iReport中加载包含参数的promt框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Jaspersoft iReport生成报告。对于传递参数,我们需要在运行时输入提示框中的值。

I use Jaspersoft iReport for generating reports. For passing parameters we need to enter the values in the prompt box during runtime.

我们可以使用字段中的值加载提示框吗?所以它看起来像一个下拉列表,我们可以从该列表框中选择值?而不是输入值。

Can we load up the prompt box with values in a field. So that it looks like a drop down list and we can select the value from that list box? Instead of typing the values.

是否可能?

推荐答案

在JasperReport服务器中,它可以轻松完成,您只需在JasperReport服务器中创建parameter1。

In JasperReport server it can be done easily, you just have to create parameter1 in JasperReport server.

在JasperReport服务器中创建输入控件

To create a Input control in JasperReport server


  1. 转到Jasper Server并右键单击要为parameter1创建输入控件的任何目录。

  2. 选择添加资源,然后选择输入控件

  3. 选择类型(如果您在数据库中有值,则单选查询。

  4. 参数名称(应与iReport中的相同)

  5. 然后查询以获取所有不同的parameter1的值

  6. 值和可见列与参数1值的数据库中的列名相同。

  1. Go to Jasper Server and right click on any directory where you want to create input control for parameter1.
  2. Select "Add Resources" then "Input Controls"
  3. Select type (Single select query) if you have values in database.
  4. Parameter name (should be same as in iReport)
  5. and then query to fetch all distinct values for parameter1
  6. Value and visible column will be same column name in database for parameter1 values.

然后只需在报告的控件和资源输入控件中添加此参数。

And then just add this parameter in "Controls and Resources" input controls of your report.

这篇关于在iReport中加载包含参数的promt框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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