Jump to content
Changes to the Jaspersoft community edition download ×

How to set up a Table from a TableModel ???


Recommended Posts



ive got a huge problem and would really appreciate

any help from you.


i just created a JRTableModelDataSource from a

real TableModel


I also know how to make tables in iReport.


The problem is, that i dont know what I have to write

into the


"Text Field Expression" Field to get the values out of my TableModel.


In the demo/samples/tables example are only string constants.


I get already an output consisting of exactly 13 rows, as my tableModel delivers but they are set to null, cause i dont know what to write into Text Field Expression.





Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Ok, got it again. For all searching sucha a solution:


The TableModel Interface (not JRTableModelDataSource) defines a function:


String getColumnName(int columnIndex)


which returns the name of the column specified with

the index.


All one has to do is to check, which names are returned by this function. In my case it were


1. "Name [de]"

2. "Name [en]"


So in iReport i created two Fields (-in the library-) and called them Name[de] and Name[en].


Then i assigned the values


$F{Name [de]} to the first TextField

$F{Name [en]} to the 2nd TextField


(In fact into the "Text Field Expression"

of my TextFields)


Hope, that this will help anyone




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...