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:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Sets the horizontal alignment.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XL | 3.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
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 |
Returns OK or error.
0 | general |
1 | left |
2 | center |
3 | right |
4 | full |
5 | justify |
6 | merge |
7 | distributed |
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 ) ]
This function checks for a license.
Created 18th August 2014, last changed 7th February 2020