[ 
https://issues.apache.org/jira/browse/OFBIZ-6427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14563216#comment-14563216
 ] 

Christian Carlow commented on OFBIZ-6427:
-----------------------------------------

Group/summarization will likely rely on sorting/seq functionality of 
OFBIZ-6428.  I'm not exactly sure how this should be implemented yet.

The simple way is to loop the sort fields in order and see if they are also 
grouped and then create a group record if one does not yet exist.  However, 
this would rely on the user making sure they don't select something that gives 
misleading grouping information.  For example if they choose to sort and group 
by customer, then sort by order date, then sort and group by product they will 
get multiple product groupings if another product was ordered between the order 
date of the next identical product.

I'll likely implement the simple way first and add an enhancement to it later 
as a separate JIRA.

> Implement FindService record grouping/summarization functionality
> -----------------------------------------------------------------
>
>                 Key: OFBIZ-6427
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6427
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Christian Carlow
>
> Just as sortSeq and sortDir will be added to find fields like ignoreCase is 
> available, groupBy check box would also enhance user query capabilities.  
> FindService would have to be extended to process the list and create 
> group/summary records.
> For example, if a grid/form lists customer orders and the user wants to 
> determine the total quantity and price of products ordered between a date 
> range, then check marking the groupBy for productId would insert a grouping 
> record before the details containing totals.
> This issue is primarily meant to handle reports for which pagination isn't 
> used because all records are displayed.  For these reports queries, group 
> totals can simply be calculated by looping each detail record.  But if 
> pagination is used, the method of calculating totals for grouping records 
> becomes more complicated because if detail records exist outside of the 
> current page but are part of a group being summarized then they will be 
> excluded from the group total unless implemented some other way.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to