The list of all columns and their attributes.

Version Introduced: 3.0.2

Usage

Set_Property(OLECtrlEntID, "OLE.ColumnList", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<0, 1>TitleTextThe column's title textRequired
<0, 2>TypeOptionThe column's expected data typeRequired
<0, 3>WidthIntegerThe column's initial widthRequired
<0, 4>AutosizedBooleanIs column autosizable flagTrue
<0, 5>ResizableBooleanIs column resizable flagsame as Autosized
<0, 6>ImageIntegerThe column's image0
<0, 7>SortableBooleanCan column be sorted flagTrue
<0, 8>VisibleBooleanIs column visible flagTrue
<0, 9>MinWidthIntegerThe column's minimum allowed width0
<0, 10>AlignmentOptionThe column's data alignmentLeft
<0, 11>Tool TipTextThe text to appear when the user hovers the cursor above the column's header""
<0, 12>FormatTextThe output format for the column's data""
<0, 13>Check BoxBooleanDetermines if the column has check boxesFalse
<0, 14>FontFontThe column's fontTahoma, 8 pt.
<0, 15>Data SourceOptionDetermines how to interpret column's items' valuesText
<0, 16>Check Box AlignmentOptionThe column's check box alignmentLeft
<0, 17>HyperlinkBooleanDetermines if the column's items are hyperlinksFalse

Remarks

The ColumnList property establishes the physical report columns. This property has nothing to do with the actual data contained within the control. It simply creates columns that will eventually contain data. Thus, this property should be called before setting the data.

The ColumnList property is a dynamic array of fields, with each field representing one column in the table. There can be any number of fields, thus any number of columns. The multivalue structure above lists the format of each field. Here is a detailed description of each column value and their effects:

At least the first 3 values of each column are required. Omitting the remaining values will set them to the defaults listed below.

Title

The column's title is the text that will appear in the header cell at the top of the report table. This can be any string of any length. Text that does not fit in the header cell is truncated.

Type

The column's type establishes the expected type of data within the row. This value determines how the report table will sort, compare, and present data in a column. The following table lists the options available:

ValueAbbr.Description
TextTThe column contains plain text that is sorted alphabetically
NumberNThe column contains numbers which are sorted numerically
DateDThe column contains dates (no times) which are sorted by date
TimeTIThe column contains time (no dates) which are sorted by time of day
DateTimeDTThe column contains dates and times which are sorted by date then time
BoolBThe column contains booleans which are sorted numerically (false = 0 and true = 1)
PreviewPThe column contains plain text that may also be used as the preview (see below)

Preview type columns are just like plain text column, however, they can also be displayed as text spanning accross the bottom of a record rather than in their own columns. This effect can be seen in Outlook 2003 when the first few sentences of an email are visible in each unread email.

There can only be one Preview column per table. If you specify more than one Preview column, then only the first preview column will be previewed while the other columns set to "preview" will simply act like plain text columns.

Width

The column's width is measured in pixels. This value determines the column's starting width. Later, when reading the ColumnList property, this value may be different if the user has resized the column.

Autosized (optional)

The column's Autosized flag determines if the column grows and shrinks automatically when the size of the Report Table changes. For columns whose Autosized flag is True the Report Table will ensure their altered sizes remain proportional to their original sizes. Omitting this value is the same as setting it to True. This property is ignored if HorizontalScroll is set.

Resizable (optional)

The column's Resizable flag determines if the column's width can be altered by the user. Set this value to False if you want the column to stay fixed at its initial width. Omitting this value will set it equal to the Autosized value.

Image (optional)

The column's Image is simply a numerical index to the image in the ImageList meant to appear in the column header. The ImageList property must have already been set for this value to work properly. A value of 0 indicates no image. Omitting this value will set the column to have no image.

Columns with images do not display any text no matter what you specify in the Title value. Thus, column headers can have images or text, but never both.

Sortable (optional)

The column's Sortable flag determines if the user is allowed to sort the column by clicking on the column header. If True, then the user can alternate between ascending or descending sort order by successively clicking the column header. Omitting this value is the same as setting it to True.

Visible (optional)

The column's Visible flag determines if the column is initially visible to the user. The user can later determine which columns they wish to see. Preview columns default to an invisible status since they will most likely appear underneath each row. Omitting this value is the same as setting it to True.

MinWidth (optional)

The column's MinWidth is the minimum width, in pixels, the user is allowed to set. This value is only used for resizable columns. Omitting this value is the same as setting it to 0.

Alignment (optional)

The column's alignment establishes whether or not the data in the column is justified to the left, center, or right. It has no bearing on how the data is sorted; thus, right justified data is still left-sorted. Here are the values you can use:

ValueAbbr.Description
LeftLLeft justify data
CenterCCenter justify data
RightRRight justify data

Tool Tip (optional)

The column's tooltip text is the text that will appear when the user hovers the mouse over the column's header for a short period of time. If empty, then no tooltip will appear. Use this when you want to provide a little extra info on the purpose of the column.

Format (optional)

The column's format determines how some column's data is displayed. This field does not apply to all columns. Futhermore, the syntax of this field depends upon the column Type. Listed below are the supported types and their respective Format syntax.

Text

You can format text, but you're limited to prefixes and suffixes. You can use any characters in the Format field, but the string "%S%" will always be swapped with the cell's contents. Any other character is treated as a literal and is displayed as is. Currently, there is no way to show "%S%" as a literal, i.e., it will alwaysbe swapped with the cell's contents.

To Display AsUse
First Name: KevinFirst Name: %S%
Kevin Esquire%S% Esquire
Code guru Kevin works for SRP Computer Solutions, Inc.Code guru %S% works for SRP Computer Solutions, Inc.

Number

Numbers are stored as floating point values within the Report Table. Thus, if your data contains decimal values, make sure you include the decimal when you load the Report Table. In other words, there is no equivalent MD2 format for the Report Table. Instead, the Report Table uses an Excel-like syntax to format and round off decimal numbers.

You can use any characters in the Format field, but '#', '0', commas, and periods are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:

CharacterDisplays
#Significant Digits Only
0Significant Digits or Insignificant Zeros
comma1. If within the number, then commas separate every three digits

2. If trailing the number, then the number is shown as an integer divided by 1000 for each trailing comma
periodDecimal point. The first decimal denotes the beginning of the fractional portion of the number. All subsequent decimals are treated as literals

Here are some example number formats:

To DisplayAsUse
1234.591234.6####.#
8.98.900#.000
.6310.60.#
44.398$44.40$0.00
1234.568$1,234.57$#,##0.00
5.255.25%0.00%
1200012,000#,###
1200012#,
1220000012.20.0,,

Date

Dates are stored in a proprietary format within the Report Table. Currently, dates must be in OI's internal format when loading them into the Report Table. In other words, the Report Table will not parse string dates on your behalf. Like Numbers, the Report Table uses an Excel-like syntax to format dates.

You can use any characters in the Format field, but 'Y', 'y', 'M', 'm', 'D', and 'd' are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:

Character(s)Displays
YYYears 00-99
YYYYYears 0001-2999
MMonths 1-12
MMMonths 01-12
MMMMonths Jan-Dec
MMMMMonths January-December
MMMMMMonths J-D
DDays 1-31
DDDays 01-31
DDDDays Sun-Sat
DDDDDays Sunday-Saturday

Only uppercase letters are used in the examples here, but lowercase are supported as well. However, uppercase is recommended because DateTime (below) uses capital 'M' to distinguish months from minutes.

Here are some example date formats, all them for the date January 1, 2006:

To Display AsUse
January 1, 2006MMMM D, YYYY
Sunday, Jan 01, 2006DDDD, MMM DD, YYYY
2006-01-01YYYY-MM-DD
1/1/06M/D/YY
Happy New Year! It's January 01!"Happy New Year! It's" MMMM DD!

Time

Times are stored in a proprietary format within the Report Table. Currently, times must be in OI's internal format when loading them into the Report Table. In other words, the Report Table will not parse string time on your behalf. The Report Table uses an Excel-like syntax to format dates.

You can use any characters in the Format field, but 'H', 'h', 'M', 'm', 'S', 's', 'A', 'a', and '0' are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:

Character(s)Displays
hHours 0-23
hhHours 00-23
mMinutes 0-59
mmMinutes 00-59
sSeconds 0-59
ssSeconds 00-59
0Milliseconds 0-9 (rounded to the nearest tenth)
00Milliseconds 00-99 (rounded to the nearest hundredth)
000Milliseconds 000-999
aa/p
aaam/pm
aaaa.m./p.m.
AA/P
AAAM/PM
AAAA.M./P.M.

Only lowercase letters are used in the examples here, but uppercase are supported as well. However, lowercase is recommended because DateTime (below) uses lowercase 'm' to distinguish minutes from months.

Here are some example time formats, all them for the time 3:30:30.345 PM:

To Display AsUse
3:30:30.345 PMh:mm:ss.000 AA
3:30:30.35 P.M.h:mm:ss.00 AAA
3:30:30.3 PMh:mm:ss.0 AA
03:30:30 Phh:mm:ss A
15:30:30h:mm:ss
15:30h:mm
The meeting is at 3:30pm"The meeting is at" h:mmaa

DateTime

DateTimes are stored in a proprietary format within the Report Table. Currently, date & times must be in OI's internal format when loading them into the Report Table. In other words, the Report Table will not parse string date & times on your behalf. Like individual Dates and Times, the Report Table uses an Excel-like syntax for formatting.

You can use any characters in the Format field, but 'Y', 'y', 'M', 'm', 'D', 'd', 'H', 'h', 'S', 's', 'A', 'a', and '0' are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:

Character(s)Displays
YYYears 00-99
YYYYYears 0001-2999
MMonths 1-12
MMMonths 01-12
MMMMonths Jan-Dec
MMMMMonths January-December
MMMMMMonths J-D
DDays 1-31
DDDays 01-31
DDDDays Sun-Sat
DDDDDays Sunday-Saturday
hHours 0-23
hhHours 00-23
mMinutes 0-59
mmMinutes 00-59
sSeconds 0-59
ssSeconds 00-59
0Milliseconds 0-9 (rounded to the nearest tenth)
00Milliseconds 00-99 (rounded to the nearest hundredth)
000Milliseconds 000-999
aa/p
aaam/pm
aaaa.m./p.m.
AA/P
AAAM/PM
AAAA.M./P.M.

Note that 'M' must be used for months and 'm' for minutes. All other codes can be either case.

Here are some example date & time formats, all them for the date & time January 1, 2006 at 3:30:30.245 PM:

To Display AsUse
January 1, 2006 at 3:30 PMMMMM D, YYYY 'at' h:mm aa
Sunday, Jan 01, 2006DDDD, MMM DD, YYYY
2006-01-01 15:30:30YYYY-MM-DD hh:mm:ss

Bool

Bools are stored as 1 or 0 within the Report Table, and booleans must be in this format when loading them into the Report Table. In other words, the Report Table will not parse string booleans on your behalf, such as "Yes," "No," "True" or "False." The Report Table uses a simple syntax for formatting.

You can use any characters in the Format field, but '[', '|', and ']' are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows (assuming a value of 1):

To Display AsUse
True[True|False]
Yes[Yes|No]
T[T|F]
The value is: TrueThe value is: [True|False]
, or ] when the value is True", or ] when the value is" [True|False]

Check Box (optional)

Set this value to 1 to add check boxes to the left side of each item in the column. See the ColumnCheckBox property for details. Omitting this value means no check boxes will appear in this column.

Font (optional)

You can customize the font of a column using this value. Use it to bold a column, or to show Wingding characters such as check marks or other symbols. Omitting this value defaults the columns to 8 pt. Tahoma.

Setting this value sets the font for both the header and the data within the column to the same font. If you want to set the header independently of the data, use the ColumnHeaderFont and ColumnFont properties.

Data Source (optional)

Use this value to determine how the items' values are determined. Omitting this value uses the Text option, which means the item's value is simply its text. However, you can also specify CheckBox or Both. See the ColumnDataSource property for details.

Check Box Alignment (optional)

The column's check box alignment establishes where the check box is placed within the items. See the ColumnCheckBoxAlignment property for more information. Here are the values you can use:

ValueAbbr.Description
LeftLPlace check box to left, text to the right
CenterCPlace check box in center, text placement is ignored
RightRPlace check box to right, text to the left

Hyperlink (optional)

The Hyperlink option can be used to turn all items in the column into hyperlinks. All you have to do is set this value to 1. If you wish to enable individual items as hyperlinks, you may use the ItemHyperlink property. Once an item is enabled as a hyperlink, the OnItemHyperlink event will fire when the user clicks on the item's text.

Example

ColumnList = "" 

// Fix the width of column 1 
ColumnList<-1> = "ID":@VM:"Number":@VM:"50":@VM:0:@VM:0 

// Let the remaining columns use default values 
ColumnList<-1> = "First Name":@VM:"Text":@VM:"200" 
ColumnList<-1> = "Middle Name":@VM:"Text":@VM:"200" 
ColumnList<-1> = "Last Name":@VM:"Text":@VM:"200" 

// Now set up the columns 
Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnList", ColumnList)

See Also

ImageList

  • No labels