Developer's reference PB2XLS for PowerBuilder

Reference > N_XLS_FORMAT > of_set_align

of_set_align() method

Set the horizontal and vertical text alignment within a cell.

Syntax

format.of_set_align ( alignment )

Parameters

AlignmentA string whose value is the alignment method

Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs.

Description

Valid horizontal alignment: 'left', 'center', 'right', 'fill', 'justify', 'merge'.
Valid vertical alignment: 'top', 'vcenter', 'bottom', 'vjustify'.
The vjustify (vertical justify) option can be used to provide automatic text wrapping in a cell. The height of the cell will be adjusted to accommodate the wrapped text. To specify where the text wraps use the of_set_text_wrap ( ) method.

Examples

format = workbook.of_add_format ( )
format.of_set_align ( 'center' )
format.of_set_align ( 'vcenter' ) 
worksheet.of_set_row ( 0, 40 )
worksheet.of_write ( 0, 0, 'A', format )