Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4    Statistic  

XL.Format.SetAlignH

Sets the horizontal alignment.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
XL 3.5 Yes Yes Yes Yes Yes
MBS( "XL.Format.SetAlignH"; Book; Format; Value )   More

Parameters

Parameter Description Example value
Book The reference to the workbook. Please use XL.LoadBook to load a file. $ref
Format The index of the format in the book to target. 0
Value The new setting. $value

Result

Returns OK or error.

Description

Sets the horizontal alignment.
Possible values:
0general
1left
2center
3right
4full
5justify
6merge
7distributed

Examples

Create left aligned format with specific font:

#create a font
Set Variable [$textFont; Value:MBS( "XL.Book.AddFont"; $book)]
Set Variable [$r; Value:MBS( "XL.Font.SetSize"; $book; $textfont; 8)]
Set Variable [$r; Value:MBS( "XL.Font.SetName"; $book; $textfont; "Century Gothic")]
#create format
Set Variable [$textFormat; Value:MBS( "XL.Book.AddFormat"; $book)]
Set Variable [$r; Value:MBS( "XL.Format.SetFont"; $book; $textFormat; $textFont)]
Set Variable [$r; Value:MBS( "XL.Format.SetAlignH"; $book; $textFormat; 1) // left]

Create header row:

#
# define a font:
#
Set Variable [ $headerFont ; Value: MBS( "XL.Book.AddFont"; $book) ]
Set Variable [ $r ; Value: MBS( "XL.Font.SetSize"; $book; $headerFont; 12) ]
Set Variable [ $r ; Value: MBS( "XL.Font.SetName"; $book; $headerFont; "Century Gothic") ]
Set Variable [ $r ; Value: MBS( "XL.Font.SetBold"; $book; $headerFont; 1) ]
#
# define a format:
#
Set Variable [ $headerFormat ; Value: MBS( "XL.Book.AddFormat"; $book) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetFont"; $book; $headerFormat; $headerFont) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetFillPattern"; $book; $headerFormat; 1) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetPatternForegroundColor"; $book; $headerFormat; MBS( "XL.Color.Pack"; $book; 200; 200; 200) ) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetAlignH"; $book; $headerFormat; 2 /* center */ ) ]
#
Set Variable [ $r ; Value: MBS( "XL.Sheet.SetRow"; $book; $sheet; $row ; 20 ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 0; "Account" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 1; "Account Group" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 2; "Report Name" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 3; "Date TS" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 4; "Text" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 5; "Text2" ; $headerFormat ) ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteText"; $book; $sheet; $row; 6; "Text3" ; $headerFormat ) ]

See also

Example Databases

Created 18th August 2014, last changed 7th February 2020


XL.Format.GetWrap   -   XL.Format.SetAlignV

Feedback: Report problem or ask question.




Links
MBS FileMaker blog