Added February 2018
You may export directly to XLS—rather than a tab or comma delimited file—using the PopupMenu system command:
$EXPCSV2XL{:inispec}
$EXPCSV2XL is like $EXPCSV except that after creating the CSV file (which is named %temp%\xtree##.csv where ## is the job number), it calls CSV2XL.SBX to convert it to XLS. If no inispec is specified, the default ini file for CSV2XL will be xtrcsv2xl.ini, with the search patch consisting of the current ppn, [p,0], and BAS:. If no xtrcsv2xl.ini is found in any of those locations, its uses the standard bas:csv2xl.ini.
If the inispec is specified—AMOS or native format, may include %ENV% variables—then is uses that filespec without any search path.
Unlike the $EXPCSV and $EXPTSV options, there is no "+" variation to open the file after creating it. Instead, this is determined by the CSV2XL initialization file Launch option.
As with the other export options, you can enable it globally by adding:
SBR=XTREE_EXPCSV2XL
to miame.ini. In the case, there is no option for the INI file, which will always be the xtrcsv2xl.ini, using the search patch specified above.
Color Support
The export to XLSX via CSV2XL function supports foreground and background colors. The feature can be enabled in one of three ways:
• By setting the system option SBR=XTREE_CSV2XLSX, either in miame.ini or by setting the SBRF2_XTREE_CSV2XLSX flag using MX_SBRFLG or AG_SBRFLAGS.
• By explicitly adding a PopupMenu option using the new $EXPCSV2XLSX special command.
• By adding the Advanced Coldef Option ExportOptions=Attr to any column, provided that the XTREE_CSV2XL global option (previously labeled "Export (XLS)" and now labeled "Export (Data Only)" option is set. The XTREE_CSV2XL global option continues to enable the generic CSV2XL export, which does not support colors or other attributes, except that the ExportOptions=Attr option will upgrade it to be equivalent to the XTREE_CSV2XLSX option. Note that ExportOptions may be applied to the zero column, in which case it enables output of color (and potentially other) attributes for all columns; otherwise it only applies to the column to which it is attached. Note that there is also an ExportOptions=NoAttr which overrides the option previously set globally.
Example:
coldef="0~0~x~H~ExportOptions=Attr~~"
...
coldef += "30~5~Test~S~RGBbg=22,33,44~ExportOptions=NoAttr~~"
The above column definitions start by enabling the export of attributes globally, and then disabling it specifically for the one "Test" column.
Comments
Support for exporting color attributes to a spreadsheet requires CSV2XL.SBX 2.1(250) or higher (see below).
When the attribute export is enabled, the spreadsheet output format will beforced to XLSX, regardless of the setting in the relevant CSV2XL INI file.
See the topic "Export to XLS" for more details on exporting to a spreadsheet.
History
2020 June, A-Shell 6.5.1682: Function added to A-Shell (color support)
2018 January, A-Shell 6.5.1626: Function added to A-Shell (export to XLS)