WPCubed Product Support

Formating missing after (WPReporter)Merge and FastAppendText

I am creating several letters in a document. The first letter looks fine but the others don't format correctly. E.g. the formatting paralCenter is lost in the first par on the second letter.
What am I missing?

wptMerge.SetSourceDest(wptSource.Memo.RTFData, wptLetter.Memo.RTFData);
    wptDest.BeginUpdate;
    i := 0;
    while i < AddressList.Count do
    begin
      CurrentAddress := TAddress(AddressList.Objects[i]);
      wptLetter.Clear;
      wptMerge.Execute;
      Section := wptDest.FastAppendText(wptLetter, true, [wpCreateNewPage]);
      Section.Select := [wpsec_ResetOutlineNums, wpsec_ResetPageNumber];
      Inc(i);
    end;
    wptDest.EndUpdate;
#1 ♥ 0
4.7k Views 2 users read 2 min
support

You use the report like the standard merge procedure. You can simply use WPRichText.Merge with a similar effect I guess.

If you want to use WPReporter You do not need to use FastAppendText.

You only need to create a group round your template and and go to the next record in the AfterGroup event.

There is a simple demo which should show this.

Julian

#2 ♥ 0

In some cases it is only addess that change, but in others there are lists with data from a database and that is why WPReporter is used. In the simple case it is nice to keep the template simple. So it is a mix of the example in the help file (7.5.4 FastAppendText: Create text with multiple letters) and the use of WPReporter. The problem I ran into is on the second letter and if the first paragraph is centered.

#3 ♥ 0
This category is archived. No new posts are possible.