Group by Expression
Hi, I wanna make a dynamic group using differents fields of a table. Then I create a parameter
in the report and linked it to the expression text of the group; when change the parameter value
via code the group stay the original was setted in the parameter. Why didn't work?
Thanks.
in the report and linked it to the expression text of the group; when change the parameter value
via code the group stay the original was setted in the parameter. Why didn't work?
Thanks.
Comments
Please show how you do this. What do you pass in the parameter?
report1.SetParameterValue("Grupo", "[Products.Field1]");
In the designer of the report I have a Group Header with the following condition in the "Edit Group" form:
Group condition
Select data column or type an expression
+
+
| [GRUPO] |
+
+
Thanks
Correct code:
Parameter parameter = report1.GetParameter("Grupo");
parameter.Expression = "[Products.Field1]";
parameter.DataType = typeof(int); // set correct data type here
another way is to set the group condition directly:
GroupHeaderBand group = report1.FindObject("GroupHeader1") as GroupHeaderBand;
group.Condition = "[Products.Field1]";
Thanks a lot...