[
https://issues.apache.org/jira/browse/FINERACT-2622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hysnije updated FINERACT-2622:
------------------------------
Description:
h3. Steps to reproduce
# Navigate to *System* > *Admin* > *Manage Reports*
# Create a report for any entity with an SQL script which contains an
"{*}Order By{*}" statement, in my example I did a select on Loans with an order
by on loan account number in ascending direction ((i) can be a simple select)
# Navigate to *Reports* and select the newly created report
# Click "{*}Run Report"{*}
h3. Actual result
Loan account numbers are *not* displayed in correct ascending numerical order
!image-2026-05-28-13-41-40-863.png!
h3. Expected result
Loan account numbers should always be displayed in {*}correct ascending
order{*}, respecting the {{ORDER BY loan.account_no ASC}} SQL clause.
h3. Additional information
The issue is that the SQL is wrapped into a subselect
[https://github.com/apache/fineract/blob/develop/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java#L202.|https://github.com/apache/fineract/blob/develop/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java#L202]
was:
h3. Steps to reproduce
h3. Actual result
h3. Expected result
> Values not sorted correctly in report output
> --------------------------------------------
>
> Key: FINERACT-2622
> URL: https://issues.apache.org/jira/browse/FINERACT-2622
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: Hysnije
> Priority: Major
> Attachments: image-2026-05-28-13-41-40-863.png
>
>
> h3. Steps to reproduce
> # Navigate to *System* > *Admin* > *Manage Reports*
> # Create a report for any entity with an SQL script which contains an
> "{*}Order By{*}" statement, in my example I did a select on Loans with an
> order by on loan account number in ascending direction ((i) can be a simple
> select)
> # Navigate to *Reports* and select the newly created report
> # Click "{*}Run Report"{*}
> h3. Actual result
> Loan account numbers are *not* displayed in correct ascending numerical order
> !image-2026-05-28-13-41-40-863.png!
> h3. Expected result
> Loan account numbers should always be displayed in {*}correct ascending
> order{*}, respecting the {{ORDER BY loan.account_no ASC}} SQL clause.
> h3. Additional information
> The issue is that the SQL is wrapped into a subselect
> [https://github.com/apache/fineract/blob/develop/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java#L202.|https://github.com/apache/fineract/blob/develop/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java#L202]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)