Jump to content
JasperReports Library 7.0 is now available ×

Alignment of elements in groups


Gustaf

Recommended Posts

Hi,

If anyone can help it would be very much appreciated!

in Detail Band I have defined 3 columns and my data source is an XML file. Depending on the content of the XML file either column 1, column 1+2 or all three columns will contain data.

 

Currently I am printing all the elements horizontally. If I have elements with no data, they will not be printed accoring to my "print when" expresseion that I have set to not print null values.

 

The thing is I want to be able to align my elements so that they are center relative to the band width. Is this possible? If I have for instance only 2 columns with data, I want to align them in the middle of the detail band. :woohoo:

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

as far as i know, this feature has not been added to iReports... at least not yet. but that would really be cool, huh?

 

anyway, there is one - although messy - workaround that i just thought of:

you might consider creating several views depending on which columns have data and which columns don't. to do this you'd have to make one for displaying two columns only and another for displaying all three columns. yes, you will be having fields that will display the same data. this is why you will also need to put in the correct conditional statements for the fields of each view. these statements will turn on/off the view.

 

just thought about another thing... you may use subreports to do the above proposed solution, this will make it a bit cleaner. one subreport for each view... instead of putting all of your views into a single report. you may even overlap your subreports (views) in your master report and, again, using conditional statements to control which view is displayed.

 

the key here is creating a suitable conditional statement that will correctly identify if a column does not have any data to display. being able to identify such a column would allow you to correctly choose the view to use at runtime.

 

tell us how it goes or if you need more clarification on this.

 

hth.

 

 

edwin

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