Man-Page
::ooxml::Default name value ::ooxml::RowColumnToString rowcol ::ooxml::StringToRowColumn name ::ooxml::Column col ::ooxml::CalcColumnWidth numberOfCharacters ?maximumDigitWidth? ?pixelPadding? ::ooxml::arrayDeleteSheet arrayVariable sheetId args ::ooxml::xl_sheets file ::ooxml::xl_read file args ::ooxml::xl_write args method numberformat args method defaultdatestyle STYLEID method font args method fill args method border args method style args method worksheet name method column sheet args method row sheet args method cell sheet {data {}} args method autofilter sheet indexFrom indexTo method freeze sheet index method presetstyles method presetsheets method view args method write filename ::ooxml::tablelist_to_xl lb args
dashDot | dashDotDot | dashed | dotted | double | hair | medium | mediumDashDot | mediumDashDotDot | mediumDashDotDot | none | slantDashDot | thick | thin
0-65
Aqua | Black | Blue | BlueRomance | Canary | CarnationPink | Citrus | Cream | DarkSlateBlue | DeepSkyBlue | Eucalyptus | Fuchsia | Gray | Green | Karaka | LavenderBlue | LightCoral | LightCyan | LightSkyBlue | Lime | Lipstick | Maroon | Mauve | MediumTurquoise | Myrtle | Navy | NavyBlue | NightRider | Nobel | Olive | OrangePeel | PeachOrange | Portage | PrussianBlue | Purple | Red | RoyalBlue | SaddleBrown | SafetyOrange | Scampi | Silver | TangerineYellow | Teal | White | Yellow | SystemBackground | SystemForeground
RGB
aRGB
0-360
up | down
left | center | right
darkDown | darkGray | darkGrid | darkHorizontal | darkTrellis | darkUp | darkVertical | gray0625 | gray125 | lightDown | lightGray | lightGrid | lightHorizontal | lightTrellis | lightUp | lightVertical | mediumGray | none | solid
top | center | bottom
positive whole number, whose contents consist of a measurement in twentieths of a point (equivalent to 1/1440th of an inch)
must be alphanumeric because the internal formats return numeric values and otherwise not kept apart.
Overwrites default values
- name = path
- (default = ".")
::ooxml::RowColumnToString rowcol
Converts coordinates from numeric row,column (0,0) to Excel style alphanumeric (A1) etc.
return name
::ooxml::StringToRowColumn name
Converts coordinates from Excel style alphanumeric (A1) to numeric row,column (0,0) etc.
return rowcol
Converts coordinate from numeric column (0) to Excel style alphanumeric (A) etc.
return name
::ooxml::CalcColumnWidth numberOfCharacters {maximumDigitWidth 7} {pixelPadding 5}
Calculates the column width based on the number of characters
return width
::ooxml:: arrayDeleteSheet arrayVariable sheetId args
Delete a sheet from array build by ::ooxml::xl_read.
- -sheetname
- sheetId is the sheetname instead of sheet number.
return nothing
return sheetInformation
Reads the tables with all the implemented information into an array.
- -valuesonly
- Read data only, no formatting
- -keylist
- Create a key list
- -sheets PATTERN
- Load only the specified table IDs
- -sheetnames PATTERN
- Load only the tables with the specified names
- -datefmt FORMAT
- Date format (default = "%Y-%m-%d %H:%M:%S")
- -as array
- Currently only array output
return workbookData
::ooxml::xl_write constructor args -creator CREATOR
- -creator CREATOR
- Set author name
- -created UTC-TIMESTAMP
- Set creation time
- -modifiedby NAME
- Set name of the last modifier
- -modified UTC-TIMESTAMP
- Set time of last modification time
- -application NAME
return class
::ooxml::xl_write method numberformat args
Creates an Excel number format (NUMFMTID) for the current workbook.
- -format FORMAT
- FORMAT can be any Excel format-string
- -general
- Excel general-format
- -date
- Date format
- -time
- Time format
- -datetime
- Date/Time format
- -iso8601
- Date/Time in ISO8601 notation
- -number
- Integer
- -decimal
- Decimal number with 2 decimal places
- -red
- Color red on negative values (can be combined with number and decimal)
- -separator
- Thousand separators (can be combined with number and decimal)
- -fraction
- Fractions
- -scientific
- Scientific numbers
- -percent
- Percentage
- -text | -string
- Text
- -tag TAGNAME
- To give the format a name. This name can also be used as NUMFMTID.
return NUMFMTID
::ooxml::xl_write method defaultdatestyle STYLEID
Set the style for the default date format (default=0) for the current workbook.
::ooxml::xl_write method font args
Create a FONTID with the following settings for the current workbook.
- -list
- Returns the list of currently defined fonts, in stead of FONTID.
- -name NAME
- (default = "Calibri")
- -family FAMILY
- (defauft = 2)
- -size SIZE
- (default = 12)
- -color COLOR
- (default = "theme 1")
- -scheme SCHEME
- (default = "minor")
- -bold
- -italic
- -underline
- -color COLOR
- -tag TAGNAME
- To give the format a name. This name can also be used as FONTID.
return FONTID
::ooxml::xl_write method fill args
Create a FILLID with the following settings for the current workbook.
- -list
- Returns the list of currently defined fills, in stead of FILLID.
- -patterntype PATTERNTYPE
- (default = "none")
- -fgcolor COLOR
- -bgcolor COLOR
- -tag TAGNAME
- To give the format a name. This name can also be used as FILLID.
return FILLID
::ooxml::xl_write method border args
Create a BORDERID with the following settings for the current workbook.
- -list
- Returns the list of currently defined borders, in stead of BORDERID.
- -leftstyle BORDERLINESTYLE
- -leftcolor COLOR
- -rightstyle BORDERLINESTYLE
- -rightcolor COLOR
- -topstyle ORDERLINESTYLE
- -topcolor COLOR
- -bottomstyle BORDERLINESTYLE
- -bottomcolor COLOR
- -diagonalstyle BORDERLINESTYLE
- -diagonalcolor COLOR
- -diagonaldirection DIAGONALDIRECTION
- -tag TAGNAME
- To give the format a name. This name can also be used as BORDERID.
return BORDERID
::ooxml::xl_write method style args
Create a STYLEID with the following settings for the current workbook.
- -list
- Returns the list of currently defined styles, in stead of STYLEID.
- -numfmt NUMFMTID
- -font FONTID
- From method font.
- -fill FILLID
- From method fill.
- -border BORDERID
- From method border.
- -xf XFID
- (default = 0) no method implemented yet
- -horizontal HORIZONTAL
- -vertical VERTICAL
- -rotate DEGREE
- -tag TAGNAME
- To give the format a name. This name can also be used as STYLEID.
return STYLEID
::ooxml::xl_write method worksheet name
Creates a new woksheet for the current workbook.
return sheet
::ooxml::xl_write method column sheet args
Column definitions for the specified worksheet.
- -index INDEX
-
- (autoincrement of column if INDEX not applied)
- -to INDEX
- -width WIDTH
- -style STYLEID
- -bestfit
- -customwidth
- -string
- -nozero
- -calcfit
return column
::ooxml::xl_write method row sheet args
Sets values for the new line or jumps to the line number for the specified worksheet.
- -index INDEX
- (autoincrement of row if INDEX not applied)
- -height HEIGHT
return row
::ooxml::xl_write method cell sheet {data {}} args
- -index INDEX
-
- (autoincrement of column if INDEX not applied)
- -style STYLEID
- -formula FORMULA
- -formulaidx SHARE
- SHARE must be integer and starts at 0. Make sure that indexing is correct, no plausibility checks are performed.
- -formularef INDEX:INDEX
- The formula is shared from INDEX to INDEX. A '-formulaidx' must be assigned. (see example: sample4.tcl)
- -string
- -nostring
- to reset "-string" defined by method "column"
- -nozero
- -zero
- to reset "-nozero" defined by method "column"
- -globalstyle
- deprecated: styles are from now (> v1.5) on predefined via method "column" and can be overwritten in method "cell"
- -height HEIGHT
- -hyperlink URL
- URL should be a http(s)://...
- -tooltip TEXT
- Is only evaluated in conjunction with a hyperlink.
return row,column
::ooxml::xl_write method autofilter sheet indexFrom indexTo
Set autofilter for the specified worksheet.
::ooxml::xl_write method freeze sheet index
Freeze panes for the specified worksheet.
::ooxml::xl_write method presetstyles workbookData
An Excel document read in with ::ooxml::xl_read with the known styles preassigned.
::ooxml::xl_write method presetsheets workbookData
An Excel document read in with ::ooxml::xl_read with the known formats and data preassigned.
::ooxml::xl_write method view args
- -list
- Returns the list of currently defined view options
- -activetab TAB
- Index to the active sheet in this book view; defaults to 0 which is tab 1.
- -x TWIPS
- X coordinate for the upper left corner of the workbook window. The unit of measurement for this value is twips.
- -y TWIPS
- Y coordinate for the upper left corner of the workbook window. The unit of measurement for this value is twips.
- -height TWIPS
- Specifies the height of the workbook window. The unit of measurement for this value is twips.
- -width TWIPS
- Specifies the width of the workbook window. The unit of measurement for this value is twips.
::ooxml::xl_write method write filename
Writes the defined Excel document.
::ooxml::tablelist_to_xl lb args
Exporting a tablelist to an Excel file.
- -callback CALLBACK
- default CALLBACK: ::ooxml::tablelist_to_xl_callback
- Callback arguments: spreadsheet sheet maxcol column title width align sortmode hide
- -path PATH
- -file FILENAME
- -creator CREATOR
- -name NAME
- -rootonly
- export tablelist root nodes only
- -addtimestamp
- add timestamp to filename
- -globalstyle
- use / recognize global styles
CALLBACK sample and default:
proc ::ooxml::tablelist_to_xl_callback { spreadsheet sheet maxcol column title width align sortmode hide } { set left 0 set center [$spreadsheet style -horizontal center] set right [$spreadsheet style -horizontal right] set date [$spreadsheet style -numfmt [$spreadsheet numberformat -datetime]] set decimal [$spreadsheet style -numfmt [$spreadsheet numberformat -decimal -red]] set text [$spreadsheet style -numfmt [$spreadsheet numberformat -string]] if {$column == -1} { $spreadsheet defaultdatestyle $date } else { switch -- $align { center { $spreadsheet column $sheet -index $column -style $center } right { $spreadsheet column $sheet -index $column -style $right } default { $spreadsheet column $sheet -index $column -style $left } } } }