Jump to content
Changes to the Jaspersoft community edition download ×

groupExpression evaluating two expressions


Recommended Posts

By: bthompson - sourceforgerer

groupExpression evaluating two expressions

2002-09-23 14:44

is it possible to do something like the following?

 

<groupExpression>($F{id} && new Boolean($F{resultsLimit}.intValue() > $V{limitCnt}.intValue()))</groupExpression>

 

I need it to group id's but also limit the number of times the group is written.

 

Thanks in advance.

 

bt..

 

 

By: Teodor Danciu - teodord

RE: groupExpression evaluating two expressions

2002-09-24 07:28

 

Hi,

 

I'm not sure I undestand what you want to do, but remeber:

Group ruptures are introduced every time the value of the

<groupExpression> changes.

 

So, you have to create a group expression who's values

will behave as you expect.

The group expression, like all the JasperReports expressions are in fact real Java expression enhanced with a special syntax to introduce parameters, fields and report variables references.

 

The only restriction I see is that the group expression cannot return primitives, but only objects.

 

I hope this helps.

Teodor

 

 

 

By: bthompson - sourceforgerer

RE: groupExpression evaluating two expressions

2002-09-24 09:44

Hi,

 

What I need is to havve the group rupture when a particular id changes but only, for example, 50 times. At that point when we have ruptured 50 times I want the group to cease rupturing even if the id changes.

 

Thanks again for the help.

 

bt..

 

 

 

 

By: Teodor Danciu - teodord

RE: groupExpression evaluating two expressions

2002-09-26 06:52

 

Hi,

 

Try something like this:

 

<groupExpression>

(

$F{resultsLimit}.intValue() >

$V{limitCnt}.intValue()

)?("NO_BREAK"):(String.valueOf($F{id}))

</groupExpression>

 

As you can see, after the limit is reached, the group expression will return the same thing over and over again and the group will never break again.

 

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