1 @c PSPP - a program for statistical analysis.
2 @c Copyright (C) 2020 Free Software Foundation, Inc.
3 @c Permission is granted to copy, distribute and/or modify this document
4 @c under the terms of the GNU Free Documentation License, Version 1.3
5 @c or any later version published by the Free Software Foundation;
6 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
7 @c A copy of the license is included in the section entitled "GNU
8 @c Free Documentation License".
11 @node SPSS TableLook File Formats
12 @appendix SPSS TableLook File Formats
14 SPSS has a concept called a TableLook to control the styling of pivot
15 tables in output. SPSS 15 and earlier used @file{.tlo} files with a
16 special binary format to save TableLooks to disk; SPSS 16 and later
17 use @file{.stt} files in an XML format to save them. Both formats
18 expose roughly the same features, although the older @file{.tlo}
19 format does have some features that @file{.stt} does not.
21 This appendix describes both formats.
24 * SPSS TableLook STT Format::
25 * SPSS TableLook TLO Format::
28 @node SPSS TableLook STT Format
29 @section The @file{.stt} Format
31 The @file{.stt} file format is an XML file that contains a subset of
32 the SPV structure member format (@pxref{SPV Structure Member Format}).
33 Its root element is a @code{tableProperties} element (@pxref{SPV
34 Detail Legacy Properties}).
36 @node SPSS TableLook TLO Format
37 @section The @file{.tlo} Format
39 A @file{.tlo} file has a custom binary format. This section describes
40 it using the syntax used previously for SPV binary members (@pxref{SPV
41 Light Detail Member Format}). There is one new convention: TLO files
42 express colors as @code{int32} values in which the low 8 bits are the
43 red component, the next 8 bits are green, and next 8 bits are blue,
44 and the high bits are zeros.
46 TLO files support various features that SPV files do not. PSPP
47 implements the SPV feature set, so it mostly ignores the added TLO
48 features. The details of this mapping are explained below.
50 At the top level, a TLO file consists of five sections. The first
51 four are always present and the last one is optional:
62 Each section is described below.
65 * PTTableLook in SPSS TLO Files::
66 * PVSeparatorStyle in SPSS TLO Files::
67 * PVCellStyle and PVTextStyle in SPSS TLO Files::
68 * V2Styles in SPSS TLO Files::
71 @node PTTableLook in SPSS TLO Files
72 @subsection @code{PTTableLook}
76 ff ff 00 00 "PTTableLook" (00|02)[version]
79 bool[nested-row-labels] 00
80 bool[footnote-marker-subscripts] 00
84 In PTTableLook, @code{version} is 00 or 02. The only difference is
85 that version 00 lacks V2Styles (@pxref{V2Styles in SPSS TLO Files})
86 and that version 02 includes it. Both TLO versions are seen in the
89 @code{flags} is a bit-mapped field. Its bits have the following
94 If set to 1, hide empty rows and columns; otherwise, show them.
97 If set to 1, use numeric footnote markers; otherwise, use alphabetic
101 If set to 1, print all layers; otherwise, print only the current
105 If set to 1, scale the table to fit the page width; otherwise, break
106 it horizontally if necessary.
109 If set to 1, scale the table to fit the page length; otherwise, break
110 it vertically if necessary.
113 If set to 1, print each layer on a separate page (only if all layers
114 are being printed); otherwise, paginate layers naturally.
117 If set to 1, print a continuation string at the top of a table that is
121 If set to 1, print a continuation string at the bottom of a table that
122 is split between pages.
125 When @code{nested-row-labels} is 1, row dimension labels appear
126 nested; otherwise, they are put into the upper-left corner of the
129 When @code{footnote-marker-subscripts} is 1, footnote markers are
130 shown as subscripts; otherwise, they are shown as superscripts.
132 @node PVSeparatorStyle in SPSS TLO Files
133 @subsection @code{PVSeparatorStyle}
137 ff ff 00 00 "PVSeparatorStyle" 00
145 | 01 00 int32[color] int16[style] int16[width]
149 PVSeparatorStyle contains eight Separators, in two groups. Each
150 Separator represents a border between pivot table elements. TLO and
151 SPV files have the same concepts for borders. @xref{SPV Light Member
152 Borders}, for the treatment of borders in SPV files.
154 A Separator's @code{type} is 00 if the border is not drawn, 01
155 otherwise. For a border that is drawn, @code{color} is the color that
156 it is drawn in. @code{style} and @code{width} have the following
160 @item @code{style} = 0 and 0 @leq{} @code{width} @leq{} 3
161 An increasingly thick single line. SPV files only have three line
162 thicknesses. PSPP treats @code{width} 0 as a thin line, @code{width}
163 1 as a solid (normal width) line, and @code{width} 2 or 3 as a thick
166 @item @code{style} = 1 and 0 @leq{} @code{width} @leq{} 1
167 A doubled line, composed of normal-width (0) or thick (1) lines. SPV
168 files only have ``normal'' width double lines, so PSPP maps both
169 variants the same way.
171 @item @code{style} = 2
175 The first group, @code{sep1}, represents the following borders within
176 the pivot table, by index:
179 @item Horizontal dimension rows
180 @item Vertical dimension rows
181 @item Horizontal category rows
182 @item Vertical category rows
185 The second group, @code{sep2}, represents the following borders within
186 the pivot table, by index:
189 @item Horizontal dimension columns
190 @item Vertical dimension columns
191 @item Horizontal category columns
192 @item Vertical category columns
195 @node PVCellStyle and PVTextStyle in SPSS TLO Files
196 @subsection @code{PVCellStyle} and @code{PVTextStyle}
200 ff ff 00 00 "PVCellStyle"
201 AreaColor[title-color]
204 ff ff 00 00 "PVTextStyle" 00
205 AreaStyle[title-style] MostAreas*7[most-areas]
209 AreaColor[color] 08 80 00 AreaStyle[style]
212 These sections hold the styling and coloring for each of the 8 areas
213 in a pivot table. They are conceptually similar to the area style
214 information in SPV light members (@pxref{SPV Light Member Areas}).
216 The styling and coloring for the title area is split between
217 PVCellStyle and PVTextStyle: the former holds @code{title-color}, the
218 latter holds @code{title-style}. The style for the remaining 7 areas
219 is in @code{most-areas} in PVTextStyle, in the following order:
220 layers, corner, row labels, column labels, data, caption, and footer.
224 00 01 00 int32[color10] int32[color0] byte[shading] 00
227 AreaColor represents the background color of an area. TLO files, but
228 not SPV files, describe backgrounds that are a shaded combination of
229 two colors: @code{shading} of 0 is pure @code{color0}, @code{shading}
230 of 10 is pure @code{color10}, and value in between mix pixels of the
231 two different colors in linear degree. PSPP does not implement
232 shading, so for 1 @leq{} @code{shading} @leq{} 9 it interpolates RGB
233 values between colors to arrive at an intermediate shade.
237 int16[valign] int16[halign] int16[decimal-offset]
238 int16[left-margin] int16[right-margin] int16[top-margin] int16[bottom-margin]
240 int32[font-size] int16[stretch]
242 int32[rotation-angle]
246 bool[italic] bool[underline] bool[strikethrough]
247 int32[rtf-charset-number]
249 byte[font-name-len] byte*[font-name-len][font-name]
254 AreaStyle represents style properties of an area.
256 @code{valign} is 0 for top alignment, 1 for bottom alginment, 2 for
259 @code{halign} is 0 for left alignment, 1 for right, 2 for center, 3
260 for mixed, 4 for decimal. For decimal alignment,
261 @code{decimal-offset} is the offset of the decimal point in 20ths of a
264 @code{left-margin}, @code{right-margin}, @code{top-margin}, and
265 @code{bottom-margin} are also measured in 20ths of a point.
267 @code{font-size} is negative 96ths of an inch, e.g. 9 point is -12 or
270 @code{stretch} has something to do with font size or stretch. The
271 usual value is 01 and values larger than that do weird things. A
272 reader can safely ignore it.
274 @code{rotation-angle} is a font rotation angle. A reader can safely
277 @code{weight} is 400 for a normal-weight font, 700 indicates bold.
278 (This is a Windows API convention.)
280 @code{italic} and @code{underline} have the obvious meanings. So does
281 @code{strikethrough}, which PSPP ignores.
283 @code{rtf-charset-number} is a character set number from RTF. A
284 reader can safely ignore it.
286 The meaning of @code{x} is unknown. Values 12, 22, 31, and 32 have
289 The @code{font-name} is the name of a font, such as @code{Arial}.
290 Only US-ASCII characters have been observed here.
292 @code{text-color} is the color of the text itself.
294 @node V2Styles in SPSS TLO Files
295 @subsection @code{V2Styles}
300 byte[continuation-len] byte*[continuation-len][continuation]
301 int32[min-col-width] int32[max-col-width]
302 int32[min-row-height] int32[max-row-height]
305 This final, optional, part of the TLO file format contains some
306 additional style information. It begins with @code{sep3}, which
307 represents the following borders within the pivot table, by index:
313 Left, right, top, and bottom inner frame.
315 Left, right, top, and bottom outer frame.
317 Left and top of data area.
320 When V2Styles is absent, the inner frame borders default to a solid
321 line and the others listed above to no line.
323 @code{continuation} is the string that goes at the top or bottom
324 of a table broken across pages. When V2Styles is absent, the
325 default is @code{(Cont.)}.
327 @code{min-col-width} is the minimum width that a column will be
328 assigned automatically. @code{max-col-width} is the maximum width
329 that a column will be assigned to accommodate a long column label.
330 @code{min-row-width} and @code{max-row-width} are a similar range for
331 the width of row labels. All of these measurements are in points.
332 When V2Styles is absent, the defaults are 36 for @code{min-col-width} and
333 @code{min-row-height}, 72 for @code{max-col-width}, and 120 for
334 @code{max-row-height}.