Jump to content
Changes to the Jaspersoft community edition download ×

Complex Layout Question


ray_lukas

Recommended Posts

I am new to Jasper Reports. So far so good. But my first report has a complicated layout and I don’t honestly see a way to do this, even after hunting around tutorials and this forum.

I need to layout items horizontally in three columns. Each item itself contains multiple fields, three to be exact. Line One contains Item One, Two, and Three, Line Two contains Item Four, Five, and Six, etc. Each Item contains three fields.

If this was Java I would have two loops, one for every item, the inner loop for each of the three fields that make up an item with a count for the number of items per line. Inner loop contains print until the inner loop is exhausted then println and continue for all the items that I need to print.

When I look at the report I need each of the fields in the “columns” to line up, field one across all vertical columns line up, same with field two, and field three. Which means the max size of the combined three fields in the dataset needs to also be known.

How can this be done in Jasper Reports?  There must be a trick.

Can you help me out.

Link to comment
Share on other sites

  • 5 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Jasper supports vertical data layout with multiple columns. But you want to layout them horizontally and orderly in three columns, which Jasper doesn’t support.

 

Yet you can use esProc to help this. With the following code, the SQL result set with 3 fields can be rearranged and combined horizontally in 9 fields. What Jasper will do is simply to display the result. 

2015-02-12_093223.jpg.b80a47626a378fb5c930b6f79074d137.jpg

 

Jasper can connect to esProc script through JDBC. It calls the script in a same way as that in which it calls the stored procedure. For more details, see http://esproc.blogspot.com/2015/02/esproc-assists-report-development_10.html .

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