Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.06.14;
Скачать: CL | DM;

Вниз

Компонент StringGrid   Найти похожие ветки 

 
Alena   (2005-05-30 20:19) [0]

Подскажите пожалуйста, как содержимое таблицы StringGrid сохранить в  файл *.txt или *.doc.


 
Anatoly Podgoretsky ©   (2005-05-30 20:35) [1]

http://podgoretsky.com/cgi-bin/dlcounter/npscnt?file=http://podgoretsky.com/ftp/Docs/Delphi/Podgoretsky/PasFiles.html&fi le_id=app-files

Это примеры, но придется затачивать и устранять ошибки в статье. Главное понятны идеи, как это сделать.


 
vertal ©   (2005-05-30 20:52) [2]

В файл CSV:

procedure ExportDrawGridToCSVFile(const Src: TDrawGrid; const Delimiter: Char; const FileName: TFileName);
var
 I, J: Integer;
 f: Text;
 LastFileMode: Integer;
 t: string;
begin
 LastFileMode := FileMode;
 FileMode := fmOpenWrite;
 try
   AssignFile(f, FileName);
   Rewrite(f);
   try
     for I := 0 to Src.RowCount - 1 do
     begin
       for J := 0 to Src.ColCount - 1 do
       begin
         if Assigned(Src.OnGetEditText) then
           Src.OnGetEditText(Src, J, I, t)
         else if Src is TStringGrid then
           t := TStringGrid(Src).Cells[J , I];
         write(f, t + Delimiter);
       end;
       writeln(f);
     end;
   finally
     CloseFile(f)
   end;
 finally
   FileMode := LastFileMode;
 end;
end;


 
Kerk ©   (2005-05-30 20:59) [3]

практически в тему:
http://delphibase.spb.ru/?action=viewfunc&topic=vclservice&id=10146



Страницы: 1 вся ветка

Текущий архив: 2005.06.14;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.053 c
3-1115390604
Dmitry
2005-05-06 18:43
2005.06.14
Как избавиться от автоматически создаваемых файлов типа _QSQ11.DB


3-1115143942
Erich
2005-05-03 22:12
2005.06.14
Как "выдрать" описание поля?


1-1117517605
Grach
2005-05-31 09:33
2005.06.14
Сжатие файлов (преобразование Фурье)


9-1111128588
Twister^^
2005-03-18 09:49
2005.06.14
cgShaders in GLS


1-1117432147
Inkotex
2005-05-30 09:49
2005.06.14
В чем разница?