Jump to content
We've recently updated our Privacy Statement, available here ×

comparatorExpression cannot find field


sravyts

Recommended Posts

Hello,

 

I'm using a crosstab with a subdataset which contains a field called "ReportResult.modificationDate" which is of a custom class TimeStamp.

In my rowGroup I define the bucket as follows:

 

<bucket order="Descending">

<bucketExpression class="java.lang.String">

<![CDATA[$F{ReportResult.primaryKey}]]>

</bucketExpression>

<comparatorExpression>

<![CDATA[((Date)$F{ReportResult.modificationDate}.getJDKDate())]]>

</comparatorExpression>

</bucket>

 

getJDKDate() returns a java.util.Date which implements the Comparable interface.

 

But I always get the exception that the field ReportResult.modificationField cannot be found.

 

 

If I put this field in the bucketExpression for testing purpose, (and remove the comparatorExpression element) then it works ok (no errors).

 

If I define the field in my main dataset it works ok as well.

 

Can anyone help me with this one?

 

Wkr,

Sofie

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

comparatorExpression is evaluated once per crosstab instance, and the evaluation happens in the report context (and not in the subdataset context). This expression must evaluate to a java.util.Comparator (and not Comparable). The comparator is used to order bucket values.

 

If you want to order the group buckets by modificationDate (assuming that such an order would make sense), you can follow the method described here.

 

HTH,

Lucian

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