procedure TMyDBGridEhExportAsCVS.CheckFirstCell;
var s: String;
begin
if FirstCell = False then
begin
s := Separator;
StreamWriteString(Stream, s);
// Stream.Write(PChar(s)^, Length(s))
end else
FirstCell := False;
end;
constructor TMyDBGridEhExportAsCVS.Create;
begin
Separator := '''','''';
inherited Create;
end;
procedure TMyDBGridEhExportAsCVS.WriteDataCell(Column: TColumnEh; FColCellParamsEh: TColCellParamsEh);
var s: String;
begin
CheckFirstCell;
s := FColCellParamsEh.Text;
StreamWriteString(Stream, s);
// Stream.Write(PChar(s)^, Length(s));
end;
procedure TMyDBGridEhExportAsCVS.WriteFooterCell(DataCol, Row: Integer;
Column: TColumnEh; AFont: TFont; Background: TColor;
Alignment: TAlignment; Text: String);
var s: String;
begin
CheckFirstCell;
s := Text;
StreamWriteString(Stream, s);
// Stream.Write(PChar(s)^, Length(s));
end;
procedure TMyDBGridEhExportAsCVS.WriteTitle(ColumnsList: TColumnsEhList);
var i: Integer;
s: String;
begin
CheckFirstRec;
for i := 0 to ColumnsList.Count - 1 do
begin
s := ColumnsList.Title.Caption;
if i <> ColumnsList.Count - 1 then
s := s + Separator;
StreamWriteString(Stream, s);
// Stream.Write(PChar(s)^, Length(s));
end;
end;