Главная страница
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
14-1117138496
Qwertyk
2005-05-27 00:14
2005.06.14
Командная работа


3-1115155542
rosl
2005-05-04 01:25
2005.06.14
данные из файла


11-1098524553
AlexR
2004-10-23 13:42
2005.06.14
Цвет текста в RichEdit e


1-1117437432
41223
2005-05-30 11:17
2005.06.14
Интерфейс


11-1098258673
IceMan
2004-10-20 11:51
2005.06.14
Как перевести строку в функцию