Need to let user group table results

5 posts, 1 answers
  1. Jennifer
    Jennifer avatar
    18 posts
    Member since:
    Aug 2011

    Posted 20 Nov 2018 Link to this post

    I have a table in my report and need to let the user pick the item they want the data grouped by.  If I have a parameter in the group by clause, is there a way to fill it with specific fields from the table?  I don't want all of the fields to be available as choices.

     

    Thank you,

     

    Jennifer

  2. Silviya
    Admin
    Silviya avatar
    399 posts

    Posted 23 Nov 2018 Link to this post

    Hello Jennifer,

    If the requirement is to change the grouping of the table based on the parameter, this can be achieved using conditional functions in expressions. The expression that changes the grouping of the crosstab group based on the value of report parameter can look as following:
    = IIF(Parameters.BooleanParameter.Value, Fields.Field1, Fields.Field2)

    The grouping expression can be changed when viewing the table group structure in Group Explorer (extended mode).

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Jennifer
    Jennifer avatar
    18 posts
    Member since:
    Aug 2011

    Posted 16 Jan in reply to Silviya Link to this post

    what I want is a dropdown that allows the user to pick what the table is grouped by.  So there would be a list of fields from the table exposed to the user and they can pick/change the grouping they want from that list.
  4. Answer
    Silviya
    Admin
    Silviya avatar
    399 posts

    Posted 21 Jan Link to this post

    Hi Jennifer,

    Based on the provided information, I created a demo report that demonstrate the scenario. The report could be opened with Telerik Standalone Designer version R3 2018 or higher. From my understanding, the table contains N columns with different fields and you need to group these data based on user's choice (a report parameter containing a list of fields names). 

    This could be done by introducing an additional data source for the fields names. Here are the steps to create the Table item definition from the example:
    - Create the first data source (that should be bound to the Table to show the detail data). In the example it contains three fields - PartNumber, Type and Color
    - Create the second data source (that should be used in the report parameter's AvailableValues). In the example it contains just one field - GroupBy and it's detail rows are PartNumber, Type and Color
    - Create the report parameter with AvailableValues from the second data source and ValueMember = Fields.GroupBy 
    - Create the table with columns from the first data source
    - In Table's Group Explorer -> Add group -> Parent Group -> in Expression input add 
    = Fields(Parameters.GroupBy.Value).

    As a side note, you could use nested IIF conditional functions that would result the same. Example:
    = IIF(Parameters.GroupBy.Value = "PartNumber", Fields.PartNumber, IIf(Parameters.GroupBy.Value = "Type", Fields.Type, IIf(Parameters.GroupBy.Value = "Color", Fields.Color, "")))

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Jennifer
    Jennifer avatar
    18 posts
    Member since:
    Aug 2011

    Posted 22 Jan Link to this post

    Thank you.  This is exactly right.
Back to Top