Éric Moreau
asked on
Crystal Reports : Centering a field on a row that has a cell with CanGrow set to True
I have a field on a report that has its CanGrow property set to True.
On rows were the content spans on 2 or 3 lines, I would like the other fields of the same row to be centered on the row.
How can I do that?
ee-cr.png
On rows were the content spans on 2 or 3 lines, I would like the other fields of the same row to be centered on the row.
How can I do that?
ee-cr.png
ASKER
yes vertically.
Your idea would work for odd number of lines but not for even number of lines!
And instead of hard coding 25 as the number of characters per line, is there a way to find the actual height of a grown field? Maybe I could play with the Top properties of other fields then.
Your idea would work for odd number of lines but not for even number of lines!
And instead of hard coding 25 as the number of characters per line, is there a way to find the actual height of a grown field? Maybe I could play with the Top properties of other fields then.
I am not aware of any way to find the actual height.
What TOP property are you referring to?
What version of Crystal?
mlmcc
What TOP property are you referring to?
What version of Crystal?
mlmcc
ASKER
The Top property of the IFieldObject.
I am using CR 13 (for Visual Studio 2013).
I am using CR 13 (for Visual Studio 2013).
I don't use .Net or that version. Can you change values for each record?
mlmcc
mlmcc
ASKER
Values of Top? Never tried. But useless unless I can get the actual height of the grown field.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Too bad it is not supported by CR. Thanks for confirming.
Crystal can't do it directly.
I have done that through formulas.
Basic idea
Determine the number of lines the can grow field will take
If there are <CR><LF> in the text you can count them. If not then divide the length of the field by the number of characters that fit in the box (may have to play with the number to get the right number)
Font size 10 is 12 characters per inch size 12 is 10 characters per inch
To vertically center
add a chr(13) <CR> for every 2 lines in the field.
Open in new window
mlmcc