[#3357] - Grouping and sorting the variable is not available till now

Category:
Feature request
Priority:
Urgent
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
N/A
Assigned to:

Hi Team,
I am facing issue with grouping of the column then sort the column.

<variable name="Total" class="java.math.BigDecimal" resetType="Group" resetGroup="Group_Id" calculation="Sum">
<variableExpression><![CDATA[$F{Core_Number}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.valueOf(0)]]></initialValueExpression>
</variable>

Then , i am trying to sort
<sortField name="Total" order="Descending" type="Variable"/>

Kindly look into it. I had tried Jasper Java api also for sorting using JRDesignSortField

List<JRSortField> sortList = new ArrayList<JRSortField>();
JRDesignSortField sortField = new JRDesignSortField();
sortField.setName("Total");
sortField.setOrder(SortOrderEnum.DESCENDING);
sortField.setType(SortFieldTypeEnum.VARIABLE);
sortList.add(sortField);
//add other sortfields here
reportParams.put(JRParameter.SORT_FIELDS, sortList);

v5.5
sunflowerrahul's picture
Joined: Nov 5 2013 - 10:23pm
Last seen: 8 years 6 months ago

7 Comments:

#1
  • Assigned:nobody»

Any update on this? If this feature is not available then we have to scrap to use the Jasper Report in our organization. I am working on POC Jasper Report. Please let me know asap.

#2
  • Assigned:» anonymous

Providing a full self contained sample to illustrate the issue would help. Currently it's not clear what the problem is.

Regards,
Lucian

#3

Hi Lucian,
I am doing the grouping on one of the field say 'X' and one of the field SAY 'V' which has calculation="Sum" .

Below is the sample

X Y
IBM 100
IBM 100
IBM 200
HP 100
Accenture 500
Accenture 200
HP 100

After applying the Grouping by X column and calculation ="Sum" on the Y column, got the below result
X Y
IBM 400
Accenture 700
HP 200

Issue now that when i am trying to generate the report after applying the SORT FIELD using variable for 'Y', it didn't sort it either desc or ascen.

Hope that helps to understand the doubt. if not please let me know.

#4
#5

Any update guys? otherwise have to inform the client this features is not available in the jasper . please let me know.

#6

I can confirm that sort fields cannot be used to sort records based on group totals. We could consider that as a enhancement, but for now it doesn't work.

#7
  • Priority:High» Urgent

Thanks Lucian for confirming . Could you please confirm us about this enhancement, whether you will take this in the next release. So that we can plan according to that for others type of report also. could you please assign to someone ,so that we can track this ticket.

Thanks,
Rahul Bhandari

Feedback
randomness