To assert greater control over details of the output file formatting, you may optionally insert //XL directives into the CSV file. These should be at the top, before any data lines, except in the case of the //XL,SetRow directive, which may be inserted anywhere above the affected row(s).
The syntax for the //XL directives is a bit tricky, and differs from normal A-Shell conventions. See Notes on Syntax.
//XL,SetDefaultFont{,fontname=<fontface>}{,fontsize=<pointsize>}
Establish the default font face and name to be used by the spreadsheet app.
Example:
//XL,SetDefaultFont,fontname=Courier New,fontsize=12
//XL,DefineFont {fontid=}<fontid>, {name=<name>} {,size=<pointsize>} {,color=COLOR_xxx}, {Common //XL Parameters}
Define a font and give it an identifier which can then be used in a subsequent DefineFormat directive. This is only necessary when you want to use the same font in multiple formats, columns or rows. Otherwise, you can specify the font attributes directly when defining the format or setting the column or row attributes.
Examples:
//;Define bold green font, assign fontid “bold_green”
//XL,DefineFont,fontid=bold_green,bold,COLOR_GREEN
//;Define 14 Courier font, name it “courier14”
//XL,DefineFont,fontid=courier14,fontsize=14, fontname=Courier New
//XL,DefineFormat, {formatid=}<formatid>, {Common //XL Parameters}
Define a format and give it an identifier which can then be used in a subsequent SetCol and SetRow directives. This is only necessary when you want to use the same format in multiple columns or rows. Otherwise, you can specify the format attributes directly in the SetCol and/or SetRow directives.
Examples:
//;Define format named “fmtx” using bold_green font
//XL,DefineFormat,formatid=fmtx,fontid=bold_green,ALIGNH_CENTER
//;Define format named “fmtpink” with pink bg, bold violet text
//XL,DefineFont,formatid=fmtpink, FILLPATTERN_SOLID, patternfgc=COLOR_PINK, bold, fontcolor=COLOR_VIOLET
//XL,SetCol, {colfirst=}<##>, {collast=<##>}, {width}, {Common //XL Parameters}
Set attributes for a column or set of columns. Note that you have the option of referencing a previously defined format via the formatid=<formatid> parameter, in which case you should not specify any of the other font or format-related parameters. (A format includes a font.) Otherwise, you can specify any of the individual font and/or format parameters to effectively define the font and format on the fly.
Note that if the collast parameter is omitted, it is assumed to be the same as colfirst. If the first parameter is not named, it is assumed to be colfirst.
The SetCol directive(s) should be specified at the top of the file, before any data.
Examples:
//;Set column 3 to bold
//XL,SetCol,3,bold
//;Set columns 4-6 to have yellow background
//XL,SetCol,colfirst=4,collast=6,FILLPATTERN_SOLID, patternfgc=COLOR_YELLOW
//;Set column 7 to use predefined format name fmtspecial
//XL,SetCol,colfirst=7,formatid=fmtspecial
//XL,SetRow, {row = ##}, {height = ##}, {Common //XL Parameters}
Set attributes for a row. You may specify a row by number using the row=## parameter; the first row of the spreadsheet is considered row 1, whether it contains headings or data. It should be specified before the affected data rows. If the row parameter is omitted, the directive affects the next row to be output. Height is set in typographical points.
//XL,SetINI,<inifile>
Establishes the INI file, overriding the one specified in the printer initialization file or XCALL. For example:
//XL,SetINI,BAS:CUSXLS.INI
//XL,AddSheet {,srcbook=xxx.xls} {,dstbook=yyy.xls} {,sheetname=zzz}{,index=1}
Allows you to define the name of the sheet, and/or add it to an existing workbook, and/or change the name of the output workbook. All four parameters are optional, but you need at least one to make any sense:
Parameter |
Description |
srcbook= |
Specifies the source workbook to which you are appending the sheet, e.g. srcbook=mybook.xls Default is to create a new book. |
dstbook= |
Specifies the destination workbook to save the result as. Can be same as srcbook. Default is the original CSV file (with .xls extension, and optionally with a -# sequence number appended to the name – see AppendSeqno in [Post] section of the INI file.)) |
sheetname= |
Specifies the name you want to assign to the sheet. Default is "sheet1". Note: must be unique within the workbook! |
index=# |
Causes the new sheet to be inserted at position #. Default is to append to the end. |