Developer's reference PB2XLS for PowerBuilder

Reference > N_XLS_WORKSHEET > Header and footer string

Header and footer string

The header and footer is a combination of plain text and control characters.

ControlDescription
&LLeft justification
&CCenter justification
&RRight justification
&PPage number
&NTotal number of pages
&DDate
&TTime
&FFile name
&AWorksheet name
&fontsizeFont size
&"font,style"Font name and style
&USingle underline
&EDouble underline
&SStrikethrough
&XSuperscript
&YSubscript
&&Literal ampersand &

Text in headers and footers can be justified (aligned) to the left, center and right by prefixing the text with the control characters &L, &C and &R.
For example:

worksheet1.of_set_header( '&RHeader', 0.50 ) //Header justified to the right    
worksheet2.of_set_header( '&LHeader', 0.50 ) //Header justified to the left    
worksheet3.of_set_header( '&CHeader', 0.50 ) //Header justified to the center    

For simple text, if you do not specify any justification the text will be centred. However, you must prefix the text with &C if you specify a font name or any other formatting.
You can have text in each of the justification regions:

worksheet.of_set_header( '&Rright text&Ccenter text&Lleft text', 0.50 )

You can specify the font size of a section of the text by prefixing it with the control character &n where n is the font size:

worksheet1.of_set_header('&L&40Big header', 0.50 )
worksheet2.of_set_header('&L&9Small header', 0.50 )

You can specify the font of a section of the text by prefixing it with the control sequence &"font,style" where font is a font name such as "Arial" or "Times New Roman" and style is one of the standard Windows font descriptions: "Regular", "Bold" , "Italic"or "Bold Italic":

worksheet.of_set_header('&L&"Arial,Bold"Header', 0.50 )