Symptom
When editing a text within the text objects in Crystal Reports (CR) 2008 by default the text align at the start top location within the text box How to align a text at the vertical bottom location like the alignment of the text appears at the start bottom location within the cell in MS Excel?
Environment
Crystal Reports 2008
Resolution
Local StringVar outText:= "";
Local NumberVar NumberOfLines:= 5;
Local NumberVar LineLength:=60;
Local NumberVar Returns:=
Truncate(NumberOfLines/2) -
Truncate(Length({YourText})/(LineLength * 2));
Local NumberVar i;
For i:= 1 to Returns Do
(
outText:= outText + chr(13)
);
outText:= outText + {YourText};
For i:= 1 to Returns Do
(
outText:= outText + chr(13)
);
outText
Above code would help us to centre a text alignment of variable length in a text box with 5 lines, now Set "Can Grow" to true and it will centre the text vertically in a 5 to 6 line textbox.
To vertically align the text to the bottom within the text box replace
Code
Truncate(NumberOfLines/2) -
Truncate(Length({YourText})/(LineLength * 2));
with
Truncate(NumberOfLines) -
Truncate(Length({YourText})/(LineLength));
Keywords
Text Alignment, Vertical, Text Rotation , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem