Problem with interactive sort when dynamically changing group

  • Hi folks,

    I have row groups as such:
    ParentUnit -> Unit -> Details

    I created a parameter to change the ParentUnit Row Group grouping from 'ParentUnit' to 'Employee' (a field in the detail section) based on a specific selection. I also hide the 'ParentUnit' group and change the sorting so that I can see all the employees together.  This all works fine until I try to use the interactive sort.  I can make it work for one selection or the other but not both at the same time.  The problem I see is not being able to change the sort scope based on the parameter.  I can either Sort the detail row by Employee and it works when I group by ParentUnit but not by Employee.  If I change it to Sort the Group (ParentUnit) by Employee it works when I group by Employee but not ParentUnit.

    Any ideas?


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • Y.B. - Tuesday, July 31, 2018 12:59 PM

    Hi folks,

    I have row groups as such:
    ParentUnit -> Unit -> Details

    I created a parameter to change the ParentUnit Row Group grouping from 'ParentUnit' to 'Employee' (a field in the detail section) based on a specific selection. I also hide the 'ParentUnit' group and change the sorting so that I can see all the employees together.  This all works fine until I try to use the interactive sort.  I can make it work for one selection or the other but not both at the same time.  The problem I see is not being able to change the sort scope based on the parameter.  I can either Sort the detail row by Employee and it works when I group by ParentUnit but not by Employee.  If I change it to Sort the Group (ParentUnit) by Employee it works when I group by Employee but not ParentUnit.

    Any ideas?

    Based on what you posted, nope.  I can't see what you see, so no clue as to what the problem may be.

  • Lynn Pettis - Tuesday, July 31, 2018 1:21 PM

    Y.B. - Tuesday, July 31, 2018 12:59 PM

    Hi folks,

    I have row groups as such:
    ParentUnit -> Unit -> Details

    I created a parameter to change the ParentUnit Row Group grouping from 'ParentUnit' to 'Employee' (a field in the detail section) based on a specific selection. I also hide the 'ParentUnit' group and change the sorting so that I can see all the employees together.  This all works fine until I try to use the interactive sort.  I can make it work for one selection or the other but not both at the same time.  The problem I see is not being able to change the sort scope based on the parameter.  I can either Sort the detail row by Employee and it works when I group by ParentUnit but not by Employee.  If I change it to Sort the Group (ParentUnit) by Employee it works when I group by Employee but not ParentUnit.

    Any ideas?

    Based on what you posted, nope.  I can't see what you see, so no clue as to what the problem may be.

    Well, I was very specific about my issue so I don't know how else to explain it...but let me try.

    These are the conditions I have the Parent Unit Row Group:
    Group Expression
    =iif(Parameters!GroupBy.Value="ParentUnit",Fields!ParentUnit.Value,Fields!Employee.Value)
    Sort Expression
    =IIf(Parameters!GroupBy.Value="ParentUnit",Fields!ParentUnit.Value,Fields!Employee.Value)

    By default this is how the interactive sort is setup.  This works fine when grouped by ParentUnit because it sorts the employees alphabetically within the group.  When the parameter and thus the grouping changes this sort is no longer functional.  I can, however, change the SCOPE to sort by Group (instead of detail rows) and then sort by Employee.

    The issue is there doesn't seem to be a way to change the scope in an expression.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • I found a workaround that functionally gets me what I'm looking for but it's not elegant.  Basically, I duplicated the header row and only show one or the other based on the parameter selection.  That allows me to essentially have two interactive sort buttons with different conditions but it only looks like one to the end user.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • Y.B. - Tuesday, July 31, 2018 2:23 PM

    I found a workaround that functionally gets me what I'm looking for but it's not elegant.  Basically, I duplicated the header row and only show one or the other based on the parameter selection.  That allows me to essentially have two interactive sort buttons with different conditions but it only looks like one to the end user.

    FYI, the picture you displayed in your previous post provides a way to specify an expression for the sort scope.   It's the very next line down from where your sort expression is.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • sgmunson - Tuesday, August 7, 2018 12:40 PM

    Y.B. - Tuesday, July 31, 2018 2:23 PM

    I found a workaround that functionally gets me what I'm looking for but it's not elegant.  Basically, I duplicated the header row and only show one or the other based on the parameter selection.  That allows me to essentially have two interactive sort buttons with different conditions but it only looks like one to the end user.

    FYI, the picture you displayed in your previous post provides a way to specify an expression for the sort scope.   It's the very next line down from where your sort expression is.

    I was actually pointing to that field because the property doesn't appear to allow expressions.  In VS I am used to property fields that support expressions having a drop down which allows you to open to 'Expression' dialog box.  In this case, SortExpressionScope does not.  Now if there are some properties that can still be changed with expressions anyway than that would be good to know.  The truth is I'm thinking of redesigning the report anyways.  The way it is now It will cause me more issues if the end users ask me to make certain changes, and anybody who writes reports know, "they" ALWAYS want changes. 😉


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply