[Demos] Mail Merge

Demos, code samples. Only questions related to the existing topics are allowed here.
Sergey Tkachenko
Site Admin
Posts: 13637
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Thu Jul 16, 2015 5:05 pm

Only call of Format requires a parent form.

Workaround for this problem:
1) Assign some form as a parent, but make the component hidden
or
2) Use TRVReportHelper.RichView. TRVReportHelper is formatted using Init method, and it does not require a parent form.

Sergey Tkachenko
Site Admin
Posts: 13637
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demos] Mail Merge

Post by Sergey Tkachenko » Thu Nov 30, 2017 9:48 am

One more mail merging demo:

http://www.trichview.com/support/files/ ... edtext.zip

Field codes: text in {}, for example {NAME}.
Field values: multiline text, optionally with the specified color.

Unlike previous mailmerge-text demos, it uses RVInsertString function from RVInsertItems unit, so its code is much simpler.

Code: Select all

procedure RVInsertString(RVData: TCustomRVData; ItemNo: Integer;
  const s: String; StyleNo, ParaNo: Integer; const Tag: TRVTag = RVEMPTYTAG);
(if ParaNo = -1, this function adds a new text item without starting a new paragraph)

PS: In Report Workshop, you can define text color in field format strings and using $if commands.

Post Reply