如何从jasper报告设计师中的参数设置背景颜色
我正在使用Jasper报告设计报告。我有一个报告,那里有静态文本。我想通过参数值设置其背景颜色。在XML中,它为这样的文本生成:
< reportElement模式=“ opaque” x =“ 434” y =“ 0” width =“ 121” height =“ 12” backcolor =“#a6a6a6” uuid = uuid = uuid = “ E088BD9F-A0AC-4F34-9375-DF765C829EC2”/>
。
现在,我需要从数据库中的参数设置后色。在这里,例如#A6A6A6
。
接下来我可以尝试什么?我已经研究了它,但是没有运气。
I am using Jasper Report for designing report. I have a report where there is a static text. I want to set the background color of it by parameter value. In the XML it generates for the text like this:
<reportElement mode="Opaque" x="434" y="0" width="121" height="12" backcolor="#A6A6A6" uuid="e088bd9f-a0ac-4f34-9375-df765c829ec2"/>
.
Now I need to set the backcolor from a parameter which will come from database. for here like #A6A6A6
.
What can I try next? I have researched it, but no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
在您的情况下,您需要
You can do that with net.sf.jasperreports.style.* element level properties (for which you can have expressions as values).
In your case you would need
单击“透明”
click the "transparent"