procedure TForm1.bPreviewClick(Sender: TObject);
var s:TMemoryStream;
begin
s:=TMemoryStream.Create();
try
PrintDBGridEh1.DBGridEh := DBGridEh1;
RichEdit1.Lines.SaveToStream(s);
s.Position:=0;
PrintDBGridEh1.BeforeGridText.LoadFromStream(s);
finally
s.free;
end;
PrintDBGridEh1.SetSubstitutes(['%[Today]',DateToStr(Now)]);
PrintDBGridEh1.Preview;
end;