The options - Detailed

The minimum set of options for the tt expositor is empty, this means that none of the options is mandatory (and that's why they are called 'options'). The default values of all options are set so they match the former behaviour of the tt expositor. This means that you should be able to replace your current version of the tt expositor with this one without having to alter the calling of the procedure (see also 'disclaimer').

The following options are supported:

FileType option list
Short description : determine the output type of the tt expositor
Valid in modes : All
Default value : TXT

This corresponds to the old 'switch'. To maintain backward compatibility this is the only option that needs not be in the form 'option:value' but can be as well in the form 'value'. Valid value is one of the character values defined in tt-file.i. These are: txt, xls, csv, xls, slk or df. If left blank, the type will be derived from the filename (even if prompted). If the filename does not have a valid type, it will be assumed a text file.

Note: Excel spreadsheets require access to the desktop, so they cannot be run in batch mode.

Note: XML files do not like special characters in your fieldnames so these are filtered out. In the examples you will see the fieldname 'Track#' to appear as 'Track'. This may cause some problems if your temptable holds both 'Track#' and 'Track'.
The Sylk spreadsheet format was added to allow generation of spreadsheets in batch programs. While the format is outdated, it is still accepted by Excel. The Sylk format allows some special formatting options in this routine for date and time values. Time can be formatted as "HH:MM", "HH:MM AM", "HH:MM:SS", "HH:MM:SS AM". Dates can be formatted as "MM/DD/YY", "DD-MMM-YY", "Month DD, YYYY", "YYMMDD", "YYYYMMDD". To assist you, the following preprocessor constants are defined: tt-fmt-hm, tt-fmt-hm-a, tt-fmt-hms, tt-fmt-hms-a, tt-fmt-mdy, tt-fmt-dmy, tt-fmt-md-y, tt-fmt-ymd, and tt-fmt-cymd. You can use them like this: define variable date-var as date format {&tt-fmt-dmy}. define variable time-var as integer format {&tt-fmt-hms}. If you are showing a number, and you use the format chars "9" or "Z", the format results in forcing that many places. For example: define variable zip-code as integer format "99999". define variable four-dig as integer format "Z,ZZ9".

Note: There are lots of notes about the Sylk format in the code for those that are interested.

FieldList option list
Short description : provide a list of fields to be shown
Valid in modes : TXT XLS CSV XLS SLK DF XML
Default value : *

The FieldList is defined as a series of field names within the temp table, each seperated with a comma. The default values are defined to select all fields of the temp table. If you provide a list of fields in the FieldList, then only those fields will be shown.

If you provide lists for both FieldList and SkipList, then only those fields in the FieldList that are not in the SkipList will be shown. Example: FieldList:cust-name,cust-num,sales-rep SkipList:sales-rep Shown Fields are: cust-name and cust-num

Note: If you use FieldList for DF output and you skip fields that participate in an index, no error is reported, but the produced DF file is corrupt, since there will be an index reference to the field you skipped. Use with care!

SkipList option list
Short description : provide a list of fields to skip in the output
Valid in modes : TXT XLS CSV XLS SLK DF XML
Default value : (empty)

The SkipList is defined as a series of field names within the temp table, each seperated with a comma. The default values are defined to select all fields of the temp table. If you provide a list of fields in the SkipList, then those fields will not be shown.

If you provide lists for both FieldList and SkipList, then only those fields in the FieldList that are not in the SkipList will be shown. Example: FieldList:cust-name,cust-num,sales-rep SkipList:sales-rep Shown Fields are: cust-name and cust-num

Note: If you use SkipList for DF output and you skip fields that participate in an index, no error is reported, but the produced DF file is corrupt, since there will be an index reference to the field you skipped. Use with care!

Append option list
Short description : indicates to append an existing file or not.
Valid in modes : TXT CSV DF XML
Default value : false

You can specify that you want to append to an existing file. If the file does not exist, this setting has no effect.

ExcelAlert option list
Short description : indicates to complain if a file already exists.
Valid in modes : XLS
Default value : true

When you export to XLS, try to save the file and it already exists, Excel asks you wether you would like to overwrite this file or not. By specifying 'ExcelAlert:false' you can override this. If a file already exists, Excel will no longer complain, but overwrite the existing file.

Note: ExcelVisible and ExcelAlert work independent of each other. When you specify 'ExcelVisible:no' and 'ExcelAlert:yes' then, when Excel tries to save the file you still get feedback from Excel if the file already exists.

ExcelVisible option list
Short description : indicates wether Excel is visible or not.
Valid in modes : XLS
Default value : true

When Excel does it's thing, you may choose not to see it using the setting 'ExcelVisible:false'. When set, all actions will be completed silently.

Note: ExcelVisible and ExcelAlert work independent of each other. When you specify 'ExcelVisible:no' and 'ExcelAlert:yes' then, when Excel tries to save the file you still get feedback from Excel if the file already exists.

Labels option list
Short description : indicates wether Column labels should be displayed.
Valid in modes : TXT
Default value : true

If you do not want the labels to appear above the text, you can specify 'labels:false'. This is especially useful when you want to append to an already existing report.

Title option list
Short description : Title of the browse.
Valid in modes : BRS
Default value : 'tt-browse'

This title is used in the title bar of the browse.

ReturnList option list
Short description : List of fields to be returned (values).
Valid in modes : BRS
Default value : (empty)

The values of the fields you list here get returned, separated by CHR(1) chars. The string can be retrieved by accessing the RETURN-VALUE after the invokation of tt-file.p.

FirstOfList option list
Short description : display only fields that are different from the previous line.
Valid in modes : TXT CSV XLS SLK
Default value : (empty)

This option is a list of fields you want to be printed only when they change value. This gives you the possibility to display blanks instead of a field if it is the same as the previous record. In the good old progress 4Gl you would solve this with a construction like:

for each OrderLine break by OrderNum.CustomerNum
by OrderLine.OrderNum
by OrderLine.OrderLine:
display
OrderLine.CustomerNum when first-of OrderLine.CustomerNum
OrderLine.OrderNum when first-of OrderLine.OrderNum
OrderLine.OrderLine
OrderLine.ItemNum.
end.

With the tt expositor you would specify 'FirstOfList:CustomerNum,OrderNum'.

Grid option list
Short description : display lines between rows and columns as a grid.
Valid in modes : TXT
Default value : false

You can specify that you want a horizontal or vertical grid to appear. This is disabled by default. You can specify a horizontal grid with 'grid:hor', a vertical grid with 'grid:ver' or set them both with 'grid:true'. When enabled, a line, consisting of '-' chars is printed after each line and the column separator ' | ' is printed after each column.

Note: using a default grid enlarges your output. It makes the output both longer (twice as long) and wider (2 extra chars for each column).
You can specify which characters to use and after how many lines a horizontal separater should appear using 'GridCharHor', 'GridCharVer', 'GridCharCross', 'GridInterval' and 'GridField'. Please take a closer look at the grid examples below.

GridCharHor option list
Short description : define the character to use as the horizontal separator.
Valid in modes : TXT
Default value : -

This is the character to use as the horizontal separator. You can specify more then a single character. When you do, this affects the wideness of the report since the character printed between two columns is Space + CrossChar + Space. If you specify a more-than-one-char GridCharHor (say '--=='), the Spaces in the above formula are expanded to match the number of chars in your GridCharHor so in the above example the column separator will become ' + '.

GridCharVer option list
Short description : define the character to use as the vertical separator.
Valid in modes : TXT
Default value : |

You can specify a separator longer than 1 char. If you do, make 'GridCharCross' and 'GridCharVer' both the same length for proper display.

GridCharCross option list
Short description : the character at the crossing of a hor. and a ver. line.
Valid in modes : TXT
Default value : +

You can specify a separator longer than 1 char. If you do, make 'GridCharCross' and 'GridCharVer' both the same length for proper display.

GridInterval option list
Short description : the number of lines between two horizontal gridlines
Valid in modes : TXT
Default value : 1

This determines how often a gridline is displayed. You can use this to make your output more readable. If you set this to 0, no horizontal gridlines are displayed.

GridField option list
Short description : if this field changes, a gridline is displayed.
Valid in modes : TXT
Default value : (empty)

If you want a horizontal gridline to appear only when a certain field changes its value. You can specify only one field. A good value would be the last field you specified in the 'FirstOfList' option. See the examples below.

AttributeList option list
Short description : list of fields used as XML record identifiers.
Valid in modes : TXT
Default value : (empty)

If you want the record to be identifyable you can specify one or more attributes for the record. These show up in the XML document in the tag that represents your temp-table (see Example 10).