I have a column in a report that hold a small circle. I determine the fill color of the circle dynamically with database fields. The width of this column is static and I can center the circle horizontally. The height of the rows, however, is dynamic and I cannot get the circle to center on each row. The circle always seems to be at the top of the row instead of directly in center. Is there something I am missing to center this vertically? The vertical align property doesn't seem to work for me.
Other Info: 1. On this report, I am not using a table. I am using text boxes and report groups. Maybe the shape needs to be in a panel?
2. The shape is being used as a subreport on the main report. Do I need to center the sub report on the main report?
Your help is appreciated.
6 Answers, 1 is accepted
property will affect only the text inside the report item. However, it will not position the item itself.
You can place the Shape item inside the Panel item and set Style.Padding.Top property for this panel. The value of this property can also be changed dynamically using bindings and expressions.
Telerik by Progress
I think I have gotten a little further in diagnosing the cause. At first, I thought it was the shape causing the issues. Now, I am almost certain that it is subreports. I cannot seem to dynamically center anything in a subreport vertically. See the attached image to give a better idea of what I am trying to accomplish.
The two items with red arrows pointing down are sub reports which will not center vertically. The rest, which are centered vertically, at text boxes which is much easier to do.
The exact setting of the report are not clear. Applying VerticalAlign=True to the TextBox aligns the text correctly on our side. Double check if this property is set to true for all the TextBoxes containing text.
To align a Shape item you can apply padding to the Panel item containing this shape and change it dynamically with bindings and expressions.
Another approach is to set an image that displays a circle as BackgroundImage in TextBox or Panel Style properties.
Telerik by Progress
Another thing that I have seen, the Location property is being ignored. In the code behind I have set:
var left = parent.Width.Multiply(.5D).Subtract(Unit.Pixel(6));
var top = parent.Height.Multiply(.5D).Subtract(Unit.Pixel(6));
GoalCircle.Location = new PointU(left, top);
Since my circle is 12 pixels, i will take half of the width and half of the height minus 6 pixels to get the center. This property seems to be ignored in my ItemDataBinding Event.
As of R3 2016, the changes applied to item definition in events are ignored - Changes on items in report events are not applied.
Instead of accessing the item definition (GoalCircle.Location) you need to get the processing item, for example:
To get the processing child item you can use ElementTreeHelper.GetChildByName Method.
Instead of using events, you can also apply bindings and expressions to change the properties of the item dynamically.