Jasper中表名的动态参数 [英] Dynamic parameter of table name in Jasper

查看:209
本文介绍了Jasper中表名的动态参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的事情

select * from $P{TABLENAME_VAR}  

JR报告中的

但是我得到了无效的表名异常,尽管参数包含正确的表名

in JR report but I am getting invalid table name exception though the parameter contain proper table name

这里的场景是我想根据用户提供的输入动态填充表的名称,所以我正在做的是

The scenario here is I want to populate the name of the table dynamically based on the input provided by the user so what I am doing is

我创建了一个参数。现在根据用户选择的输入,将特定的表名分配给此变量,但是当我尝试将此参数作为表名分配给报表时,我收到无效的表名例外。

I have created a parameter . Now based on the input selected by the user a particular table name is assigned to this variable but when I am trying to assign this parameter as table name in report I am getting Invalid table name exception.

推荐答案

我发现这个答案只是做了

I found the answer to this one just do

select * from $P!{TABLENAME_VAR}

select * from $P{TABLENAME_VAR}

这篇关于Jasper中表名的动态参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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