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

Java String [][] Array into Jasper


ziden

Recommended Posts

 Hello there.

     Im having an issue about passing an two dimensional array to jasper so he can build up some sort of table with it. Its a normal table, with 2 variables that represent lines/columns. The array is filled during the Java process and its sent to Jasper as a Class into a JRBeanCollection. What ive needed to do is reading the lines size of the array, then draw some sort of table representing the array positions. Is that possible ? Witch one would be the better way of acomplishing that ? Ive seem some methods on Jasper but im not sure on how to, that would be the CrossTable and the Sub-Report for instance.

   Thanx for any help.

 

PS: Im using IReport 1.2.6 for this task. I know its an Older Version, but its what we gotta use here to work it out. Thanx.

 

[]´s Gabriel Slomka

Unicamp - Brazilian State University

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If your data are organized as String[][], a better approach is to use a JRTableModelDataSource instead of a JRBeanCollection. Also, if you don't need special headers and/or row/column calculations, you can draw a simple table just using the <detail/> band, and setting your detail band and report elements with appropriate x, y, width, height and border properties. Be careful that report elements do not overlap.

For more informations about, take a look at the datasource sample, and then try to run it.

Hope this helps,

sanda

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