This is a migrated thread and some comments may be shown as answers.

Need to let user group table results

5 Answers 201 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Jennifer
Top achievements
Rank 1
Jennifer asked on 20 Nov 2018, 11:36 PM

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

5 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 23 Nov 2018, 01:21 PM
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
0
Jennifer
Top achievements
Rank 1
answered on 16 Jan 2019, 05:05 PM
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.
0
Accepted
Silviya
Telerik team
answered on 21 Jan 2019, 01:06 PM
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
0
Jennifer
Top achievements
Rank 1
answered on 22 Jan 2019, 07:43 PM
Thank you.  This is exactly right.
0
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Oct 2023, 11:34 PM
Is there any chance the Report view may one day allow for drag and drop groupings. Sorta like how the Kendo UI Grid allows for it?
Todor
Telerik team
commented on 10 Oct 2023, 02:42 PM

Hi Joshua,

You may log the requirement in our public feedback portal so that other users may vote for it and increase its priority.

Tags
Report Designer (standalone)
Asked by
Jennifer
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Jennifer
Top achievements
Rank 1
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or