I'm looking for a way to let the user choose grouping condition.
I've tried by defining a variable: `group`, and setting Group Header Band's condition to that. In server-side, I fill this variable with column names like `{DataSource1.CostCenterName}`. It doesn't seem to be working. I also tried it without curly brackets, '{'.
Please let me know if there's a way to implement this, with variables or any other way that you might suggest.
Thanks for your support,
Dynamic Grouping
Re: Dynamic Grouping
Hello,
I have created a sample report for you. Please check attached report. In report you need create a boolean report variable. Also you need add condition to the group header band which uses this variable. Please check attached images.
Thank you.
I have created a sample report for you. Please check attached report. In report you need create a boolean report variable. Also you need add condition to the group header band which uses this variable. Please check attached images.
Thank you.
- Attachments
-
- Group-With-Conditions.mrt
- (35.39 KiB) Downloaded 383 times
-
- Image2.png (234.79 KiB) Viewed 2217 times
-
- Image1.png (20.95 KiB) Viewed 2217 times
Re: Dynamic Grouping
I have several different groupings, e.g. based on customer, date, etc. So, the only way to implement this is to put all of the group headers in the report and disable or enable them based on user's selection? Isn't there any way to pass the column name in a variable? This way I can have only one group header in the report, and fill it with any column name that I like (I never do two or more groupings simultaneously)
Thanks for your attention Jan,
Thanks for your attention Jan,
Re: Dynamic Grouping
Hello.
You could do it in code after loading of the report template with next code:
Or you could use Choose() function in Group Header condition like in the attached report template.
Thank you.
You could do it in code after loading of the report template with next code:
Code: Select all
var group = report.GetComponentByName("GroupHeaderBand1");
(group as StiGroupHeaderBand).Condition.Value = "{Products.SupplierID}";