ComponentOne List 8.0 for ActiveX
ExportToFile Method

 

True DBList Reference> TDBList Methods> ExportToFile Method

ExportToFile Method

The ExportToFile method exports the specified rows from the control to the specified file as an HTML table.

Syntax

TDBList.ExportToFile pathname, append, [selector], [tablewidth]

Arguments

pathname specifies the file to which list rows are exported.

append is a Boolean that specifies whether rows are added to the end of the file.

selector is an optional RowSelectorConstants value that specifies the rows to be exported.

tablewidth is an optional variant used to qualify the generated <table> tag.

Return Value

None

Remarks

Method applies to TDBList control.

The append argument should be set to True to add the table to the end of an existing file, False to overwrite the entire file. In either case, the file is created if it does not exist.

The selector argument determines the rows to be exported. It can be one of the following constant values:

0 - dblRSAllRows

All available rows are exported. If the selector argument is omitted, this value is assumed.

1 - dblRSSelectedRows

Only selected rows are exported. The control's SelBookmarks collection contains a bookmark for each selected row.

2 - dblRSCurrentRow

Only the current row is exported.

If specified, the tablewidth argument is used as the width option of the generated <table> tag. This argument is defined as a variant to accommodate both numeric and string qualifiers. For example, an integer value denotes an absolute width in pixels, while the string "75%" indicates that the table should occupy three-fourths of the available page width.

The HTML code generated by this method contains a single <table> tag with a <tr> entry for each data row and a <th> entry for each control caption. Normally, you will insert this table into another HTML file that serves as a template for the page to be browsed.

The output preserves as much of the control's original formatting as possible, including colors, fonts, alignment, and relative column widths.

Note: ExportToFile is a standalone method; it should not be surrounded by calls to ExportBegin and ExportEnd. To export a subset of the available rows, use the ExportRows method instead of ExportToFile.

See Also

TDBList and TDBCombo Controls

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback