Create Your Application

  1. Open Visual Studio and create a new ASP.NET Empty Web Application.

    image

  2. In the Solution Explorer, select the project and choose Add New Item... from the Project main menu.

    In the opened dialog Add New Item, select Web Form and confirm with Add.

    image

  3. In the Solution Explorer, select the newly created Web Form and choose Component Designer from the View main menu.

    Find the MailMerge component in the Toolbox and drag and drop an instance onto the Component Designer form.

    Repeat this step with the ServerTextControl component.

    image

  4. Select the MailMerge component and set the TextComponent property to serverTextControl1 - the name of the inserted instance of ServerTextControl.

    image

  5. While the project is selected in the Solution Explorer, choose Add Existing Item... from the Project main menu.

    In the opened dialog Add Existing Item, browse to the following sample folder:

    %USERPROFILE%\Documents\TX Text Control 25.0.NET Server for ASP.NET\Samples\ASP.NET\CSharp\Documentation Tutorials\MailMerge\Tutorial

    or

    %USERPROFILE%\Documents\TX Text Control 25.0.NET Server for ASP.NET\Samples\ASP.NET\VB.NET\Documentation Tutorials\MailMerge\Tutorial

    Select the following 2 files: template.docx and sample_db.xml and click the Add button.

    image

  6. Select the Web Form in the Solution Explorer and choose Designer from the View main menu.

    Find the Button control in the Toolbox and drag and drop an instance onto the Web Form.

    image

  7. Double-click the button and insert the following code to the event handler:

    Loading...
    Loading...
  8. In the same code view, add the following code to the Page_Load event:

    Loading...
    Loading...
  9. Compile and start the application. Press the button to create the report that is returned as a PDF file.