cxGridExportLink
var
c: TcxGrid;
a: integer;
begin
a := TComponent(Sender).Tag;
case a of
0: begin
SaveDialog.Filter := 'Файлы MS Excel|*.xls';
SaveDialog.DefaultExt := '.xls';
end;
1: begin
SaveDialog.Filter := 'Текстовые файлы|*.txt';
SaveDialog.DefaultExt := '.txt';
end;
2: begin
SaveDialog.Filter := 'Файлы HTML|*.htm;*.html';
SaveDialog.DefaultExt := '.html';
end;
3: begin
SaveDialog.Filter := 'Файлы XML|*.xml';
SaveDialog.DefaultExt := '.xml';
end;
end;
InitSaveDialog();
if SaveDialog.Execute then begin
case RzPageControl1.ActivePageIndex of
0: c := cxGrid1;
1: c := cxGrid2;
2: c := cxGrid3;
3: c := cxGrid4;
end;
case a of
0: ExportGridToExcel(SaveDialog.FileName, c);
1: ExportGridToText(SaveDialog.FileName, c, False, True, '~');
2: ExportGridToHTML(SaveDialog.FileName, c);
3: ExportGridToXML(SaveDialog.FileName, c);
end;
end;