SaveDialog1.Filter := 'Text files (*.txt)|*.TXT|Htm files (*.htm)|*.HTM|Csv files(*.csv)|*.CSV';
if Savedialog1.Execute then
begin
FileExt:=AnsiUpperCase(ExtractFileExt(SaveDialog1.filename));
if (FileExt='.HTML') or (FileExt='.HTM') then
rep.exporttoFilter(TQRHTMLDocumentFilter.Create(savedialog1.filename))
else
if FileExt='.TXT' then
rep.exporttoFilter(TQRAsciiExportFilter.Create(savedialog1.filename))
else
if FileExt='.CSV' then
rep.exporttoFilter(TQRCommaSeparatedFilter.Create(savedialog1.filename));
end;