Jump to content
Changes to the Jaspersoft community edition download ×

How can i solve this? (2 records in same row)


Recommended Posts

Hey, i have a db like:
Type | Question | Answer | Picture
A      | x             |  y           | null
B      | abc         | def         | path

The report i build simple:
$f{question}  $f{answer}    | detailband 1 (print when $f(type).equals("A"))
| IMAGE |                            | detailband 2 (print when $f(type).equals("B")
And this works nice. 

But i would like to save some space and place:
| IMAGE |      | IMAGE |     
-> that means the 2nd record with type B should be in this case in the same row as the 1st with type B.

Do you have an idea or do you know a way how it is possible?


i found a semi-solution but still need to make it fine. (sorry, i translated it the wrong way -> i meant 2 records from the sql query in the same row)
When i add columns in the page Format and paste in the source: printOrder="Horizontal" it does exactly what i want.

1st data -> picture is left. 2nd data picture is right. 


but i have like 8 different detailbands and i need this option just for 2 detailbands.

Is it possible to make the same thing like adding multiple columns in pageformat just for 2 detailbands and the rest is default with just 1 column?


Here are some pictures: https://imgur.com/a/qgmYUzK

there you see i have different bands. The important one is detail6. There i want the picture and textfield to be printed horizontally. 
The other detailbands should be printed normally.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Did you try to place the elements on top of eachother and just use the print when option in the element. So each image would have its own print when expression.
Should work, I just created a dummy report with 2 image element on top of eachother, with print when epxression and it worked.  

Link to comment
Share on other sites

  • 2 months later...

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