The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ExportHTMLTable


Unit:SDL_replist
Class:TRLData
Declaration: procedure ExportHTMLTable (FName: string; LoC,LoR,HiC,HiR: integer; ColumnSelection: array of integer; Border, CellSpacing, CellPadding: integer; IncludeHeader: boolean; HeadClass, CellClass, TableClass: string); {Pascal}
void __fastcall ExportHTMLTable(AnsiString FName, int LoC, int LoR, int HiC, int HiR, const int * ColumnSelection, const int ColumnSelection_Size, int Border, int CellSpacing, int Cellpadding, bool IncludeHeader, AnsiString HeadClass, AnsiString CellClass, AnsiString TableClass); {C++}

The method ExportHTMLTable generates an HTML table and appends the HTML code to the text file FName. If the file does not yet exist, it is created. The parameters LoC, LoR, HiC, and HiR specify the range of the data table which should be published as HTML table (lowest column and row, highest column and row, respectively). Alternatively, you may specify a list of columns to be exported in the open array ColumnSelection. If ColumnSelection is not empty, only those columns are exported which are contained in ColumnSelection (in the order of the specification in ColumnSelection). Thus ColumnSelection may be used to export any number of columns in any order. Leaving it empty forces all columns between LoC and HiC to be exported.

The parameters Border, CellSpacing, and CellPadding define the border width, the distance between cells, and the distance within cells, respectively (all in pixel units).

Setting the parameter IncludeHeader to TRUE generates an extra row containing the column headers. The parameters HeadClass, CellClass, and TableClass specify the classes of the various table elements as defined in the style sheet of the HTML file. Setting the class definitions to an empty string will omit the class specification in the corresponding HTML tag.

Hint: The declaration of ExportHTMLTable in C++ slightly differs from the Pascal declaration (note the extra parameter ColumnSelection_Size which specifies the highest index of the ColumnSelection array):

Example: The following statement exports all rows of the first, the fifth and the fourth column of the report listview RL1 to the HTML file "test.html":
RL1.ExportHTMLTable ('test.html', 0,1,0,RL1.NrOfRows, [1,5,4], 0, 0, 4, true, 'head', '', '');



Last Update: 2012-Oct-20