Jump to content
We've recently updated our Privacy Statement, available here ×

iReport and JavaBean Ext DataSource


2004 IR Help

Recommended Posts

By: Mistrani - mistrani

iReport and JavaBean Ext DataSource

2004-11-16 00:24

Hi all,

I have a problem using a JavaBean external DataSource with iReports 0.4.0.

I would like to get an object in my Bean (which is an object itself, so I need a field of this bean object)..

I try to make the question as clear as possible...

 

JavaBean1--> Home

I want to get the attribute "Door", which is another bean, so...

JavaBean2--> Door

I need an attribute which is inside "door", i.e. "description".

 

How can I get this attribute? I tried to select it in the tree selection, but it doesn't work. (Error retrieving field value from bean: description -- Unknown property 'description'). Please help!

 

Thanks all.

 

 

 

 

By: Giulio Toffoli - gt78

RE: iReport and JavaBean Ext DataSource

2004-11-17 04:16

You can use an expression, instead declare a field.

This expression can be saved as variable.

 

((JavaBean1)$F{YourBean}).getDoor()

 

Giulio

 

 

 

 

By: Mistrani - mistrani

RE: iReport and JavaBean Ext DataSource

2004-11-23 02:24

Sorry, but it seems it doesn't work.

I try to add my bean as $F{MyBean}, but iReport doesn't accept it (Attribute?"class"?with?value?"myClass"?must?have?a?value?from?the?list?"java.lang.Object...").

What am I doing wrong?

1) DataSource

2) javaBean Ext DataSource

3) class name = mySuperClass

4) add Fields (which contain a field myClass)

5) defining a new variable ((myClass)($F{myClass})).getNumber() which returns an Integer.

Link to comment
Share on other sites

  • 6 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have used this solution for both javafx tableviews and jasperreports:

Create a method in the composite class wich returns the child's description.

For example:

public class Class

{

 private OhterClass otherclass;

        public String getOtherClassDesc()

        {

                   return this.otherclass.getDescription();

        }

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...