Test Application

[Top]  [Chapter] 

You can use the provided test application to test the different modes, flags and options.

You can apply an option to editor 1 and also to editor 2 or both editors at once.

 

clip0069

 

You can also test how the mail merge can be used in TextDynamic.

 

We have integrated support for DBF data bases since this was possible without having to install external database drivers. Since the mail merge support uses events you can access any database which is supported by your development system and also insert calculated data.

 

In the demo however you can open a DBF file using the menu item "Open DBF Database"

clip0098

 

After the database was opened You can insert fields using the sub menu of the menu entry "Insert Field". Moving to next or previous record will also update the data in the text (you can press F2 and F3 to scroll through the database)

 

Example Form

 

clip0101

"Show Field-Names Mode"     "Field Contents"          

 

The demo also allows to create a list or multiple letters:

 

clip0104

Example Form

 

The Template is in editor #1, the created list in editor #2:

 

clip0103

 

 

 

The (pascal) code which does mail merge and creates the list:

// Don't show the red field markers

     wp.Memo2.SpecialTextAttr(2).Hidden := TRUE;

// copy the template (styles, header + footer)

     wp.Memo2.LoadFromString(wp.Memo.SaveToString(false,'WPT'),false,'WPT');

// Clear the body text

     wp.Memo2.Clear(true, true);

// Move to first record

     Dbf1.First;

// Merge template in first editor for all records in table

    while not Dbf1.Eof do

    begin

       wp.Memo.MergeText('');

      // append the current text in editor 2

      if Sender=SimpleList1 then

             wp.Memo2.AppendOtherText(0)

      else wp.Memo2.AppendOtherText(1);

      // Mode  0: simply append the other text.

      // Mode  1: create a new page and appends the text.

      // Mode  2: create a new page and section and appends the text.

      // Mode  3: appends the text as new section (also copies header+footer!)

       Dbf1.Next;

    end;

// Reformat the second editor and display it

     wp.Memo2.ReformatAll(false,true);

 

 

 

 

 


[testapplication.htm]    Copyright © 2007 by WPCubed GmbH