Главная страница
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.071 c
8-1109365806
Hedrox
2005-02-26 00:10
2005.06.14
Проигрывание треков


4-1113980046
dimasih
2005-04-20 10:54
2005.06.14
Знатокам TService in a Delphi 5.0


8-1108553563
cuppykx
2005-02-16 14:32
2005.06.14
Пиксели цифровой камеры


6-1111941558
ALex_2000
2005-03-27 20:39
2005.06.14
DataSnap (Socketconection)


14-1117048305
Defunct
2005-05-25 23:11
2005.06.14
Просто треплюсь ;)