Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.023 c
1-1117393944
TButton
2005-05-29 23:12
2005.06.14
pointInPoly


14-1116931370
VX
2005-05-24 14:42
2005.06.14
Где узнать Все свойства Всех компонент Delphi?


14-1117043795
Almaz
2005-05-25 21:56
2005.06.14
Оскорбления вместо помощи - где наше взаимоуважение ?


1-1117434043
Lenochka
2005-05-30 10:20
2005.06.14
Как удалить форму?


6-1110720210
DereckWhite
2005-03-13 16:23
2005.06.14
API для работы с сетью




   Наверх