Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2013
    Posts
    14

    Unanswered: Sort Group According to selection of group in crystal reports

    Hi All,
    I have 4 groups, namely, Customer Group, Product Group, Country and Sales Rep Name.
    I want the grouping to be done , in a way, when the user selects the Customer group as Sort By, the report should be showing results grouped by Customer-Group in Ascending Order. If the user selects ,Product group as the sort by, then result should be sorted and grouped by Product Group Only.

    I have been trying using the group sort order formula, but i am not getting the desired result. Now the output is
    like Customer Group--> product group--> Country --> Sales Rep Name
    its not one group at a time, its grouping and sub grouping. So only the customer group, grouping is coming correctly. Rest of the groups are being repeated multiple times.
    Can anyone help me to get my desired output?

    Thanks In Advance to all.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Create a new formula:
    Code:
    If {?SortOrder} = "Customer" Then
        {Customer Group}
    Else If {?SortOrder} = "Product" Then
        {Product Group}
    Else If {?SortOrder} = "Country" Then
        {Country}
    Else
        {Sales Rep Name}
    Use this to sort your results!
    George
    Home | Blog

  3. #3
    Join Date
    Mar 2013
    Posts
    14

    Sort Group According to selection of group in crystal reports

    Thankyou Gvee,
    i also made a single group formula, and and made only one group, by using this formula,

    Formula

    If RpptParam.SortBy ='Customer Group' Then
    Rptresult.Custgrp.GpDesc.
    else if RpptParam.SortBy ='Product Group' then
    Rptresult.Productgrp.PRDGRPDESC
    Else if RpptParam.SortBy ='Country' then
    Rptresult.Customer.Country
    else if RpptParam.SortBy ='Sales Rep'
    then Rptresult.salesrep.Name
    created group using this formula and group footer is summarizing accordingly. Now the output is perfectly fine.


    Quote Originally Posted by gvee View Post
    Create a new formula:
    Code:
    If {?SortOrder} = "Customer" Then
        {Customer Group}
    Else If {?SortOrder} = "Product" Then
        {Product Group}
    Else If {?SortOrder} = "Country" Then
        {Country}
    Else
        {Sales Rep Name}
    Use this to sort your results!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •