listview ExportToHTML method
Return to Introduction  Previous page  Next page
Applies to
acListView and acDBListView components.  

Declaration
procedure ExportToHTML(const FileName: String; ExportColumnCaptions: Boolean = True; const DocumentName: String = '');  

Description
The ExportToHTML procedure can export all items and columns (if ExportColumCaption parameter is True) to the HTML file specified in FileName parameter.  
 
It will create simple HTML file and put all items and columns to the table. The background color of cells with column names will be "silver".  

Example
procedure TMainForm.AsTXT1Click(Sender: TObject);  
const  
  EXT_TYPE: Array[0..1of String = ('TXT''HTML');  
  ExportConnectionsStr = 'Export Connections to %s file';  
begin  
  with SaveDialog1, (Sender as TComponent) do  
   begin  
    DefaultExt := EXT_TYPE[Tag];  
    Title := Format(ExportConnectionsStr, [UpperCase(DefaultExt)]);  
    FilterIndex := Tag + 1;  
    if Execute then  
     if Tag = 0 then  
       acListView1.ExportToTXT(FileName)  
     else  
       acListView1.ExportToHTML(FileName);  
   end;  
end;  

See also
ExportToHTML method.