How to get the value of bean property in jasper report

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Hello everyone.  I have a list of beans. for reference

public static Collection<BeanWithList> getDataSource() {
        Collection<BeanWithList> coll = new ArrayList<BeanWithList>();

        BeanWithList bean = new BeanWithList(Arrays.asList("London", "Paris"), 1);

        coll.add(bean);

        bean = new BeanWithList(Arrays.asList("London", "Madrid", "Moscow"), 2);
        coll.add(bean);

        bean = new BeanWithList(Arrays.asList("Rome"), 3);
        coll.add(bean);

        return coll;
    }

Now I am passing this list to jasper report by putting it into map(map.put()) and I have also created a parameter with same name and class type in main jasper report. so now if i want to set my textfield value according to this. Is tit possible with jasper report?

for first textfield value shd be

firstbean.bean property

for second textfield value shd be

firstbean.second property

aypatel90's picture
Joined: Feb 16 2014 - 8:51pm
Last seen: 8 years 3 months ago

2 Answers:

There a sample of using Java Bean Collection in demo\samples\datasource\src included with the jasperreports file. Look through the source and I think it'll answer your question.

 

htshozawa's picture
531
Joined: Dec 7 2010 - 4:52pm
Last seen: 5 years 5 months ago

Which version of ireport you are using I am not finding the path above in my ireport 5.5.0 version.

aypatel90 - 8 years 4 months ago

i also find not this path

wangnet8's picture
111
Joined: Feb 11 2014 - 11:11pm
Last seen: 8 years 4 months ago
Feedback