Developer's reference PB2XLS for PowerBuilder

Reference > N_XLS_WORKSHEET > of_set_column_format

of_set_column_format() method

Set the default format of a single column

Syntax

worksheet.of_set_column_format ( column, format )

Parameters

columnThe long whose value is the number of column
formatA reference to the n_xls_format object

Return value

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

Description

If you wish to define a column format in this way you should call the method before any calls to of_write(). If you call it afterwards it won't have any effect.
A default row format takes precedence over a default column format.

Examples

worksheet.of_set_column_format( format1 )	// Set format for first column
worksheet.of_write( 0, 0, 'Hello world' )	//Defaults to format1
worksheet.of_write( 1,  0, 'Hello world', format2 )	//Keeps format2

worksheet.of_set_row_format(0, format1)	//Set format for first row
worksheet.of_set_column_format(0, format2)	//Set format for first column
worksheet.of_write( 0, 0, 'Hello world')	// Defaults to format1
worksheet.of_write( 1, 0, 'Hello world')	//Defaults to format2