Jump to content
JasperReports Library 7.0 is now available ×

elementGroup and printWhenExpression


Recommended Posts

By: Chuck Deal - cdeal

elementGroup and printWhenExpression

2003-04-23 05:53

Would it be possible to have the attribute "printWhenExpression" work for elementGroups? This would be useful if you have a bunchh of related report items. If you were to group them and set that attriubute, then all of the elements in the group would affected.

 

This helps the maintainability of the report. It also prevents duplication of the printWhenExpression logic for each element within the group.

 

I know that I could probably acheive a similar effect by using multiple "dummy" groups. However, I'm not sure that that is the cleanest solution to all problems. For instance, in my case, I have a group that contains multiple related groups. To make my situation work, I would not only have to put the printWhenExpression for the "main" group but also the individual printWhenExpression for the "related" groups. This makes for potentially complicated code.

 

I present all of this only to build my case for the attribute. Does anyone else have an opinion?

 

Chuck Deal

 

 

 

 

By: Chuck Deal - cdeal

RE: elementGroup and printWhenExpression

2003-04-23 07:56

Actually, after re-reading my post, this argument also goes towards having multiple bands within a given group.

 

If that were possible (I would prefer that), then modifying elementGroup would not be necessary (at least for my case).

 

 

 

 

By: Teodor Danciu - teodord

RE: elementGroup and printWhenExpression

2003-04-24 06:41

 

Hi,

 

You can split a band into mutiple bands using the

dummy groups trick.

 

For example, you can split a group header into

multiple bands if you duplicate your group and

distribute the group header elements between the

two group headers that you obtain.

Duplicating a group means creating a new group

with the same group expression.

 

The detail band can be split by using multiple dummy groups that have the REPORT_COUNT

variable as their expression.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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