Page 1 of 1

Demo mailmerge-text3

Posted: Tue Mar 03, 2015 8:56 am
by Gwiasda
This demo supports »multiline text, pictures and tables«. It’s ok and works fine. It’s possible to supports blob fields too?
I have makes a template in ScaleRichView and the field values are in a database. All fields appear on the right position, but not the blob field. The blob field appear always on the end.

My code:
function TDMFDPrgHeft.LoadBlobData : TMemoryStream;
begin
Result := TMemoryStream.Create;
try
if FDQPrgHeftPrgKuText is TBlobField then
begin
TBlobField(FDQPrgHeftPrgKuText).SaveToStream(Result);
Result.Position := 0;
end;
except
Result.Free;
Result := nil;
end;
end;

procedure TDMFDPrgHeft.InsertBlobItem (RVData : TCustomRVData;
var ItemNo,
Pos : Integer);
var Stream : TMemoryStream;

begin
Stream := LoadBlobData;
if Stream<>nil then
RVData.LoadRTFFromStream(Stream);
end;