Developer's reference PB2XLS for PowerBuilder

Reference > N_XLS_WORKSHEET > of_set_column_width

of_set_column_width() method

Set the width of a single column

Syntax

worksheet.of_set_column_width ( column, width )

Parameters

columnThe long whose value is the number of column
widthThe long or double whose value is the width

Return value

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

Description

The width corresponds to the column width value that is specified in Excel. It is approximately equal to the length of a string in the default font of Arial 10.

Examples

worksheet.of_set_column_width( 0, 10 )    	 // Set width for first column
worksheet.of_set_column_width( 1, 10.5 )    	 // Set width for second column