如何使 IReport 访问 Javabean 数据源上的 get 方法堆栈
我有一个 Bean,它的一些属性是另一个 Bean 的引用,我想通过其相应的 get 方法在我的报告中显示该 bean 属性的某些属性。
例如:
class Person {
private Address ad;
public Address getAddress() {
return this.ad;
}
}
class Address {
private String city;
public String getCity() {
return this.city
}
}
我想传递一个人员集合作为报告的数据源,并且我想在报告中创建一个字段以显示集合中每个人员的地址所在的城市。
I have a Bean with some properties that is a reference for another Bean and I would like to show in my report some property of the property of the bean through its corresponding get method.
For example:
class Person {
private Address ad;
public Address getAddress() {
return this.ad;
}
}
class Address {
private String city;
public String getCity() {
return this.city
}
}
I would like pass as a DataSource for the report a Collection of Person and I would like to create a field in the report to show the city of the address of each Person in the collection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以这样声明字段:
You can declare fields like this: