Updated June 2019; see History
//XL, SetPrint, attribute=value, attribute=value,...
SetPrint allows you to set various print features, where the possible attributes and values are:
Attribute |
Value |
Description/Comment |
---|---|---|
orientation |
landscape, portrait |
Set initial orientation when printing |
header |
<text> |
Set print header/footer text. May contain macros. |
footer |
||
hmargin |
<number of inches> |
Set margin for header, footer, left, top, right, bottom |
fmargin |
||
lmargin |
||
tmargin |
||
rmargin |
||
bmargin |
||
repeatrows |
<number> |
Set number of rows to repeat at top of each page |
repeatcols |
<number> |
Set number of columns to repeat at left edge of each page |
vcenter, |
1,0 |
Values (1 for on, 0 for off) are optional |
vfitpages |
|
Set the print scaling to fit the spreadsheet on the specified number of print pages, vertically and horizontally, respectively. For example, to force the output to be scaled so that all the columns fit across a single page width, use: //XL,SetPrint,hfitpages=1 |
Note that all of the above attributes affect the current page, and thus should be specified after the page is initiated. For example, they might come after the first row data on the page.
Macros
The following macros may be used with the header and footer attributes.
Macro |
Action |
|
Macro |
Action |
---|---|---|---|---|
&L |
Start of left-justified section |
|
&E |
Set double-underline text attribute |
&P |
Current page # |
|
&R |
Start of the right-justified section |
&N |
Total # of pages |
|
&Z |
Workbook file path |
&## |
Specify font size (## points), e.g. &14 |
|
&F |
Workbook file name |
&S |
Set strikethrough text attribute |
|
&A |
Current sheet name |
&Y |
Set subscript text style |
|
&"font" |
Font, e.g. &"Times New Roman" |
&C |
Start of the center-justified section |
|
&B |
Set bold text attribute |
&D |
Current date |
|
&I |
Set italic text attribute |
&T |
Current time |
|
&& |
Literal ampersand |
&U |
Set underline text attribute |
|
|
|
History
2025 February, CSV2XL.SBX edit 299, first included with A-Shell 7.0.1769: Add attributes vfitpages and hfitpages.
2019 June, CSV2XL.SBX edit 232, first included with A-Shell 6.5.1661: Add attributes vcenter and hcenter.
2019 May, A-Shell 6.5.1660, CSV2XL.SBX edit 22: Function added to A-Shell.