How to use the CalculateSize method in C1FlexReport.
In general, RenderHeight property returns value obtained from the previous rendering of the object and thus, it cannot be used to set the properties of fields in the same record.
CalculateSize method is used to allow setting the location of fields using the RenderHeight property of another field, within the same record.
CalculateSize method of a Section can be called in OnFormat property, before accessing the RenderHeight property to set the properties of fields within the same record.
For example, refer to the below-mentioned code snippet:
Detail.CalculateSize() delta = (AddressCtl.Top + AddressCtl.RenderHeight) - LineField.Top LineField.Top = AddressCtl.Top + AddressCtl.RenderHeight Detail.Height = AddressCtl.RenderHeight
This can be added to a report’s Detail.OnFormat script to resize / replace ”LineField” field, based on the rendering of “AddressCtl” field.