ooxml

Artifact [bbbc508df1]
Login

Artifact bbbc508df1926a25646fbfd3443871ad1c040681d026baa2de41680beb5384bf:

Wiki page [man-page] by alex 2020-03-05 20:11:09.
D 2020-03-05T20:11:09.305
L man-page
P 9d44c8e8bc4d564cd760040741a3692f2dff532024f8c7ac2cbb799347bf0b1f
U alex
W 15817
<h2>
	Man-Page 
</h2>
<pre>
   ::ooxml::<a href="#default">Default</a> name value
   ::ooxml::<a href="#rowcolumntostring">RowColumnToString</a> rowcol
   ::ooxml::<a href="#stringtorowcolumn">StringToRowColumn</a> name
   ::ooxml::<a href="#calccolumnwidth">CalcColumnWidth</a> numberOfCharacters ?maximumDigitWidth? ?pixelPadding?
   ::ooxml::<a href="#xl_sheets">xl_sheets</a> file
   ::ooxml::<a href="#xl_read">xl_read</a> file args
   ::ooxml::<a href="#xl_write">xl_write</a> args
                     method <a href="#numberformat">numberformat</a> args
                     method <a href="#defaultdatestyle">defaultdatestyle</a> STYLEID
                     method <a href="#font">font</a> args
                     method <a href="#fill">fill</a> args
                     method <a href="#border">border</a> args
                     method <a href="#style">style</a> args
                     method <a href="#worksheet">worksheet</a> name
                     method <a href="#column">column</a> sheet args
                     method <a href="#row">row</a> sheet args
                     method <a href="#cell">cell</a> sheet {data {}} args
                     method <a href="#autofilter">autofilter</a> sheet indexFrom indexTo
                     method <a href="#freeze">freeze</a> sheet index
                     method <a href="#presetstyles">presetstyles</a>
                     method <a href="#presetsheets">presetsheets</a>
                     method <a href="#view">view</a> args
                     method <a href="#write">write</a> filename
   ::ooxml::<a href="#tablelist_to_xl">tablelist_to_xl</a> lb args
</pre>
<hr>
<p>
	<b><a id="BORDERLINESTYLE"></a> BORDERLINESTYLE </b> 
</p>
<p>
	dashDot | dashDotDot | dashed | dotted | double | hair | medium | mediumDashDot | mediumDashDotDot | mediumDashDotDot | none | slantDashDot | thick | thin 
</p>
<p>
	<b><a id="COLOR"></a> COLOR </b> 
</p>
<p>
	0-65<br>
	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<br>
	RGB<br>
	aRGB 
</p>
<p>
	<b><a id="DEGREE"></a> DEGREE </b> 
</p>
<p>
	0-360 
</p>
<p>
	<b><a id="DIAGONALDIRECTION"></a> DIAGONALDIRECTION </b> 
</p>
<p>
	up | down 
</p>
<p>
	<b><a id="HORIZONTAL"></a> HORIZONTAL </b> 
</p>
<p>
	left | center | right 
</p>
<p>
	<b><a id="PATTERNTYPE"></a> PATTERNTYPE </b> 
</p>
<p>
	darkDown | darkGray | darkGrid | darkHorizontal | darkTrellis | darkUp | darkVertical | gray0625 | gray125 | lightDown | lightGray | lightGrid | lightHorizontal | lightTrellis | lightUp | lightVertical | mediumGray | none | solid 
</p>
<p>
	<b><a id="VERTICAL"></a> VERTICAL </b> 
</p>
<p>
	top | center | bottom 
</p>
<p>
	<b><a id="TWIPS"></a> TWIPS </b> 
</p>
<p>
	positive whole number, whose contents consist of a measurement in twentieths of a point (equivalent to 1/1440th of an inch)
</p>
<hr>
<p>
	<b><a id="default"></a>::ooxml::Default</b> name value 
</p>
<p>
	Overwrites default values 
</p>
<ul>
	<dl> 
		<dt> name = path</dt>
		<dd> (default = ".") </dd>
	</dl>
</ul>
<hr>
<p>
	<b><a id="rowcolumntostring"></a>::ooxml::RowColumnToString</b> rowcol 
</p>
<p>
	Converts coordinates from numeric row,column (0,0) to Excel style alphanumeric (A1) etc. 
</p>
<ul>
	<p>
		return name 
	</p>
</ul>
<hr>
<p>
	<b><a id="stringtorowcolumn"></a>::ooxml::StringToRowColumn</b> name 
</p>
<p>
	Converts coordinates from Excel style alphanumeric (A1) to numeric row,column (0,0) etc. 
</p>
<ul>
	<p>
		return rowcol 
	</p>
</ul>
<hr>
<p>
	<b><a id="calccolumnwidth"></a>::ooxml::CalcColumnWidth</b> numberOfCharacters {maximumDigitWidth 7} {pixelPadding 5} 
</p>
<p>
	Calculates the column width based on the number of characters 
</p>
<ul>
	<p>
		return width 
	</p>
</ul>
<hr>
<p>
	<b><a id="xl_sheets"></a>::ooxml::xl_sheets</b> file 
</p>
<ul>
	<p>
		return sheetInformation 
	</p>
</ul>
<hr>
<p>
	<b><a id="xl_read"></a>::ooxml::xl_read</b> file args 
</p>
<p>
	Reads the tables with all the implemented information into an <a id="workbookData"></a>array. 
</p>
<ul>
	<dl> 
		<dt>-valuesonly</dt>
		<dd>Read data only, no formatting</dd>
		<dt>-keylist</dt>
		<dd>Create a key list</dd>
		<dt>-sheets PATTERN</dt>
		<dd>Load only the specified table IDs</dd>
		<dt>-sheetnames PATTERN</dt>
		<dd>Load only the tables with the specified names</dd>
		<dt>-datefmt FORMAT</dt>
		<dd>Date format (default = "%Y-%m-%d %H:%M:%S")</dd>
		<dt>-as array</dt>
		<dd>Currently only array output</dd>
	</dl>
	<p>
		return workbookData 
	</p>
</ul>
<hr>
<p>
	<b><a id="xl_write"></a>::ooxml::xl_write</b> <b>constructor</b> args -creator CREATOR 
</p>
<ul>
	<dl> 
		<dt>-creator CREATOR</dt>
		<dd>Set author name</dd>
	</dl>
	<p>
		return class 
	</p>
</ul>
<hr>
<p>
	<b><a id="numberformat"></a>::ooxml::xl_write</b> method <b>numberformat</b> args 
</p>
<p>
	Creates an Excel number format (<a id="NUMFMTID"></a>NUMFMTID) for the current workbook. 
</p>
<ul>
	<dl> 
		<dt>-format FORMAT</dt>
		<dd>FORMAT can be any Excel format-string</dd>
		<dt>-general</dt>
		<dd>Excel general-format</dd>
		<dt>-date</dt>
		<dd>Date format</dd>
		<dt>-time</dt>
		<dd>Time format</dd>
		<dt>-datetime</dt>
		<dd>Date/Time format</dd>
		<dt>-iso8601</dt>
		<dd>Date/Time in ISO8601 notation</dd>
		<dt>-number</dt>
		<dd>Integer</dd>
		<dt>-decimal</dt>
		<dd>Decimal number with 2 decimal places</dd>
		<dt>-red</dt>
		<dd>Color red on negative values (can be combined with number and decimal)</dd>
		<dt>-separator</dt>
		<dd>Thousand separators (can be combined with number and decimal)</dd>
		<dt>-fraction</dt>
		<dd>Fractions</dd>
		<dt>-scientific</dt>
		<dd>Scientific numbers</dd>
		<dt>-percent</dt>
		<dd>Percentage</dd>
		<dt>-text|-string</dt>
		<dd>Text</dd>
	</dl>
	<p>
		return NUMFMTID 
	</p>
</ul>
<hr>
<p>
	<b><a id="defaultdatestyle"></a>::ooxml::xl_write</b> method <b>defaultdatestyle</b> <a href="#STYLEID"> STYLEID </a> 
</p>
<p>
	Set the style for the default date format (default=0) for the current workbook. 
</p>
<hr>
<p>
	<b><a id="font"></a>::ooxml::xl_write</b> method <b>font</b> args 
</p>
<p>
	Create a <a id="FONTID"></a>FONTID with the following settings for the current workbook. 
</p>
<ul>
	<dl> 
		<dt>-list</dt>
		<dd>Returns the list of currently defined fonts, in stead of FONTID.</dd>
		<dt>-name NAME</dt>
		<dd>(default = "Calibri")</dd>
		<dt>-family FAMILY</dt>
		<dd>(defauft = 2)</dd>
		<dt>-size SIZE</dt>
		<dd>(default = 12)</dd>
		<dt>-color <a href="#COLOR"> COLOR</a></dt>
		<dd>(default = "theme 1")</dd>
		<dt>-scheme SCHEME</dt>
		<dd>(default = "minor")</dd>
		<dt>-bold</dt>
		<dd></dd>
		<dt>-italic</dt>
		<dd></dd>
		<dt>-underline</dt>
		<dd></dd>
		<dt>-color <a href="#COLOR"> COLOR</a></dt>
		<dd></dd>
	</dl>
	<p>
		return FONTID 
	</p>
</ul>
<hr>
<p>
	<b><a id="fill"></a>::ooxml::xl_write</b> method <b>fill</b> args 
</p>
<p>
	Create a <a id="FILLID"></a>FILLID with the following settings for the current workbook. 
</p>
<ul>
	<dl> 
		<dt>-list</dt>
		<dd>Returns the list of currently defined fills, in stead of FILLID.</dd>
		<dt>-patterntype <a href="#PATTERNTYPE"> PATTERNTYPE</a></dt>
		<dd>(default = "none")</dd>
		<dt>-fgcolor <a href="#COLOR"> COLOR</a></dt>
		<dd></dd>
		<dt>-bgcolor <a href="#COLOR"> COLOR</a></dt>
		<dd></dd>
	</dl>
	<p>
		return FILLID 
	</p>
</ul>
<hr>
<p>
	<b><a id="border"></a>::ooxml::xl_write</b> method <b>border</b> args 
</p>
<p>
	Create a <a id="BORDERID"></a>BORDERID with the following settings for the current workbook. 
</p>
<ul>
	<dl> 
		<dt>-list</dt>
		<dd>Returns the list of currently defined borders, in stead of BORDERID.</dd>
		<dt>-leftstyle <a href="#BORDERLINESTYLE">BORDERLINESTYLE</a></dt>
		<dd></dd>
		<dt>-leftcolor <a href="#COLOR">COLOR</a></dt>
		<dd></dd>
		<dt>-rightstyle <a href="#BORDERLINESTYLE">BORDERLINESTYLE</a></dt>
		<dd></dd>
		<dt>-rightcolor <a href="#COLOR">COLOR</a></dt>
		<dd></dd>
		<dt>-topstyle <a href="#BORDERLINESTYLE"> ORDERLINESTYLE</a></dt>
		<dd></dd>
		<dt>-topcolor <a href="#COLOR"> COLOR</a></dt>
		<dd></dd>
		<dt>-bottomstyle <a href="#BORDERLINESTYLE">BORDERLINESTYLE</a></dt>
		<dd></dd>
		<dt>-bottomcolor <a href="#COLOR">COLOR</a></dt>
		<dd></dd>
		<dt>-diagonalstyle <a href="#BORDERLINESTYLE">BORDERLINESTYLE</a></dt>
		<dd></dd>
		<dt>-diagonalcolor <a href="#COLOR">COLOR</a></dt>
		<dd></dd>
		<dt>-diagonaldirection <a href="#DIAGONALDIRECTION">DIAGONALDIRECTION</a></dt>
		<dd></dd>
	</dl>
	<p>
		return BORDERID 
	</p>
</ul>
<hr>
<p>
	<b><a id="style"></a>::ooxml::xl_write</b> method <b>style</b> args 
</p>
<p>
	Create a <a id="STYLEID"></a>STYLEID with the following settings for the current workbook. 
</p>
<ul>
	<dl> 
		<dt>-list</dt>
		<dd>Returns the list of currently defined styles, in stead of STYLEID.</dd>
		<dt>-numfmt <a href="#NUMFMTID">NUMFMTID</a></dt>
		<dd></dd>
		<dt>-font <a href="#FONTID">FONTID</a></dt>
		<dd>From method font.</dd>
		<dt>-fill <a href="#FILLID">FILLID</a></dt>
		<dd>From method fill.</dd>
		<dt>-border <a href="#BORDERID">BORDERID</a></dt>
		<dd>From method border.</dd>
		<dt>-xf XFID</dt>
		<dd>(default = 0) no method implemented yet</dd>
		<dt>-horizontal <a href="#HORIZONTAL">HORIZONTAL</a></dt>
		<dd></dd>
		<dt>-vertical <a href="#VERTICAL">VERTICAL</a></dt>
		<dd></dd>
		<dt>-rotate <a href="#DEGREE">DEGREE</a></dt>
		<dd></dd>
	</dl>
	<p>
		return STYLEID 
	</p>
</ul>
<hr>
<p>
	<b><a id="worksheet"></a>::ooxml::xl_write</b> method <b>worksheet</b> name 
</p>
<p>
	Creates a new <a id="sheet"></a>woksheet for the current workbook. 
</p>
<ul>
	<p>
		return sheet 
	</p>
</ul>
<hr>
<p>
	<b><a id="column"></a>::ooxml::xl_write</b> method <b>column</b> <a href="#sheet"> sheet </a> args 
</p>
<p>
	Column definitions for the specified worksheet. 
</p>
<ul>
	<dl> 
		<dt>-index INDEX</dt>
		<dd></dd>
		<dd>(autoincrement of column if INDEX not applied)</dd>
		<dt>-to INDEX</dt>
		<dd></dd>
		<dt>-width WIDTH</dt>
		<dd></dd>
		<dt>-style <a href="#STYLEID"> STYLEID</a></dt>
		<dd></dd>
		<dt>-bestfit</dt>
		<dd></dd>
		<dt>-customwidth</dt>
		<dd></dd>
		<dt>-string</dt>
		<dd></dd>
		<dt>-nozero</dt>
		<dd></dd>
		<dt>-calcfit</dt>
		<dd></dd>
	</dl>
	<p>
		return column 
	</p>
</ul>
<hr>
<p>
	<b><a id="row"></a>::ooxml::xl_write</b> method <b>row</b> <a href="#sheet"> sheet </a> args 
</p>
<p>
	Sets values for the new line or jumps to the line number for the specified worksheet. 
</p>
<ul>
	<dl> 
		<dt>-index INDEX</dt>
		<dd>(autoincrement of row if INDEX not applied)</dd>
		<dt>-height HEIGHT</dt>
		<dd></dd>
	</dl>
	<p>
		return row 
	</p>
</ul>
<hr>
<p>
	<b><a id="cell"></a>::ooxml::xl_write</b> method <b>cell</b> <a href="#sheet"> sheet </a> {data {}} args 
</p>
<ul>
	<dl> 
		<dt>-index INDEX</dt>
		<dd></dd>
		<dd>(autoincrement of column if INDEX not applied)</dd>
		<dt>-style <a href="#STYLEID"> STYLEID</a></dt>
		<dd></dd>
		<dt>-formula FORMULA</dt>
		<dd></dd>
		<dt>-string</dt>
		<dd></dd>
		<dt>-nostring</dt>
		<dd>to reset "-string" defined by method "columns"</dd>
		<dt>-nozero</dt>
		<dd></dd>
		<dt>-zero</dt>
		<dd>to reset "-nozero" defined by method "columns"</dd>
		<dt>-globalstyle</dt>
		<dd>deprecated: styles are from now (> v1.5) on predefined via method "column" and can be overwritten in method "cell" </dd>
		<dt>-height HEIGHT</dt>
		<dd></dd>
	</dl>
	<p>
		return row,column 
	</p>
</ul>
<hr>
<p>
	<b><a id="autofilter"></a>::ooxml::xl_write</b> method <b>autofilter</b> <a href="#sheet"> sheet </a> indexFrom indexTo 
</p>
<p>
	Set autofilter for the specified worksheet. 
</p>
<hr>
<p>
	<b><a id="freeze"></a>::ooxml::xl_write</b> method <b>freeze</b> <a href="#sheet"> sheet </a> index 
</p>
<p>
	Freeze panes for the specified worksheet. 
</p>
<hr>
<p>
	<b><a id="presetstyles"></a>::ooxml::xl_write</b> method <b>presetstyles</b> <a href="#workbookData"> workbookData </a> 
</p>
<p>
	An Excel document read in with ::ooxml::xl_read with the known styles preassigned. 
</p><hr>
<p>
	<b><a id="presetsheets"></a>::ooxml::xl_write</b> method <b>presetsheets</b> <a href="#workbookData"> workbookData </a> 
</p>
<p>
	An Excel document read in with ::ooxml::xl_read with the known formats and data preassigned. 
</p>
<hr>
<p>
	<b><a id="view"></a>::ooxml::xl_write</b> method <b>view</b> args 
</p>
<ul>
	<dl> 
		<dt>-list</dt>
		<dd>Returns the list of currently defined view options</dd>
		<dt>-activetab TAB</dt>
		<dd>Index to the active sheet in this book view; defaults to 0 which is tab 1.</dd>
		<dt>-x <a href="#TWIPS"> TWIPS </a></dt>
		<dd>X coordinate for the upper left corner of the workbook window. The unit of measurement for this value is twips. </dd>
		<dt>-y <a href="#TWIPS"> TWIPS </a></dt>
		<dd>Y coordinate for the upper left corner of the workbook window. The unit of measurement for this value is twips. </dd>
		<dt>-height <a href="#TWIPS"> TWIPS </a></dt>
		<dd>Specifies the height of the workbook window. The unit of measurement for this value is twips.</dd>
		<dt>-width <a href="#TWIPS"> TWIPS </a></dt>
		<dd>Specifies the width of the workbook window. The unit of measurement for this value is twips.</dd>
	</dl>

</ul>
<hr>
<p>
	<b><a id="write"></a>::ooxml::xl_write</b> method <b>write</b> filename 
</p>
<p>
	Writes the defined Excel document. 
</p>
<hr>
<p>
	<b><a id="tablelist_to_xl"></a>::ooxml::tablelist_to_xl</b> lb args 
</p>
<p>
	Exporting a tablelist to an Excel file. 
</p>
<ul>
	<dl> 
		<dt>-callback CALLBACK</dt>
		<dd>default CALLBACK: ::ooxml::tablelist_to_xl_callback</dd>
		<dd>Callback arguments: spreadsheet sheet maxcol column title width align sortmode hide</dd>
		<dt>-path PATH</dt>
		<dd></dd>
		<dt>-file FILENAME</dt>
		<dd></dd>
		<dt>-creator CREATOR</dt>
		<dd></dd>
		<dt>-name NAME</dt>
		<dd></dd>
		<dt>-rootonly</dt>
		<dd>export tablelist root nodes only</dd>
		<dt>-addtimestamp</dt>
		<dd>add timestamp to filename</dd>
		<dt>-globalstyle</dt>
		<dd>use / recognize global styles</dd>
	</dl>
</ul>
<p>
</p>
<p>
	CALLBACK sample and default: 
</p>
<verbatim>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
      }
    }
  }
}</verbatim>
<hr>

Z 6c23676c0cf2b5f26b7a16df53421d8b