   TColumnsDataSource Component

Properties	Methods

Unit

DSCol

Description

This component is a custom data source that allows the user to set the column order of a table or query, as well as the sort order (use the IncludeSortBy Property to disable this feature), and which columns are visible, and which not. Call the ShowFieldsDlg method to show the dialog which will allow the user to edit the dataset.

An extra feature is the inclusion of a mechanism which allows the user to select which fields to include and which to leave out in a report. The report must be developed separately, however. Disable this feature by using the IncludeReports Property

If an ini file is specified using the IniFilename property, then all selections are saved to the ini file specified. These values are recorded in a section whose title is the same as the dataset that the datasource is connected to, so if the component is used extensively, it is important to keep your dataset names unique.

Sometimes it is necessary to setup the fields based on a previous selection without showing the fields dialog, for example when opening the form containing the dataset at runtime. In these cases, use the

SetupColumns Method

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to the DataSource Component.

The author is available for employment. For details, see About TColumnsDataSource


Properties

About

IncludeSortBy

IncludeReports

IniFileName


About TColumnsDataSource Property
About Property

See Also

Applies to

TColumnsDataSource

Declaration

property About: TAbout

Description

This property does not set any attributes of the component, it simply indicates the author, copyright, and version details.


See Also

About TColumnsDataSource


About TColumnsDataSource

See Also

TColumnsDataSource was written by John Stathakis (e-mail: JLSTATH@MAIL.ICON.CO.ZA)

Version: 1.00

1996, John Stathakis

You may use this product freely, however, the source code and related documentation may not be changed in any way without the written permission of the author. Please note that the author will not accept responsibility for any loss resulting from the use of this or any other component. Any code you may receive may not be distributed in any form without written permission from the author.

Please contact me if you have any enquiries or bug reports.

Note: The author is currently available for employment. Please forward enquiries in this regard to the above e-mail address. Preferred destinations in the following order: Australia, United States, United Kingdom. Other destinations will be considered.


See Also

About TColumnsDataSource Property


IncludeSortBy Property

See Also

Applies to

TColumnsDataSource

Declaration

property IncludeSortBy: Boolean

Description

Indicates whether the user will be able to change the sorting properties of the query or table that the ColumnsDataSource is connected to. When the user changes the sort order, the SQL of the query or the Index Field Names property of the table are changed.


See Also

IncludeSortBy Property


IncludeReports Property

See Also

Applies to

TColumnsDataSource

Declaration

property IncludeReports: Boolean

Description

An extra feature is the inclusion of a mechanism which allows the user to select which fields to include and which to leave out in a report. The report must be developed separately, however.

The IncludeReports property indicates wheither this feature is included or not. The default is True.

Retrieve the selection list by using the GetFieldTotals Method.


See Also

IncludeSortBy Property


IniFileName Property

Applies to

TColumnsDataSource

Declaration

property IniFileName: string

Description

If an ini file is selected, then the users selection is written to the ini file. The information is written to a section that has the same name as the dataset connected to the datasource, so its important to keep the names of the datasets unique if the component is used extensively. The dataset is updated as soon as the user has made the selection, or when the SetupColumns method is run.


Methods

ShowFieldsDlg

SetupColumns

GetFieldTotals


ShowFieldsDlg Method

Applies to

TColumnsDataSource

Declaration

procedure ShowFieldsDlg

Description

Reads the value from the ini file (if selected - IniFileName Property), and shows the dialog box that allows the user to setup the dataset. After the dialog box is closed, then the results are written to the ini file (if selected).

Setup the fields without showing the fields dialog by using the SetupColumns method


SetupColumns Method

Applies to

TColumnsDataSource

Declaration

function SetupColumns: boolean

Description

Reads the values from the ini file (if selected - IniFileName Property), and sets up the dataset in accordance with these values. Returns true if the dataset was successfully set up, false if not (e.g. if no dataset selected)


GetFieldTotals Method

Applies to

TColumnsDataSource

Declaration

Function GetFieldTotals: TList

Description

Returns a TList containing the boolean values indicating which fields are to be included in a custom report, and which not. The order of the fields is the same as the fields of the dataset connected to the DataSource. Include or exclude the report feature by setting the IncludeReports Property