PDA

View Full Version : Mail Merge and Template


Dumas
August 4, 2006, 15:04:41
Hi,

I'm testing the evaluation TX, and I have this simple problem.

I want to make a template with to perfom mail merge, and the template have some fields, a table and more fields.

My question is, how Can I populate the table in runtime ?

I search por examples in the samples, but none of them is close.
There is some exemple of this ?

Thanks

Gunnar Giffey
August 7, 2006, 18:49:33
Hello,

You can populate a table in TX Text Control .NET by using the for-each loop:
TextControl1.Tables.Add(4, 5, 11)
Dim myTable As TXTextControl.Table = TextControl1.Tables.GetItem(11)
For Each cell As TXTextControl.TableCell In myTable.Cells
cell.Text = cell.Column.ToString + cell.Row.ToString
Next

Dumas
August 8, 2006, 15:05:39
Works great, thanks.

But now I have another question...
I want to create a document in Word, but whithout any template.
The document should be like this.

text
text

table

text
text

All the text fields and table fields will be populeted from a DataSet (I'm using C#).

My question now is. How can I create this texts fields, and how can I put the table in the middle of the page and the another text fields below the table? Because all tables that I've been created, was in the top of the page.

Thanks again.

Gunnar Giffey
August 8, 2006, 17:38:55
As you surely know, the interface of TX Text Control .NET Server is the same as for TX Text Control .NET, so you would like to recommend to read the Chapter Editing and Formatting Text From Code in the manual:
http://www.textcontrol.com/support/documentation/html/dotnet/n_formatting.htm

You have to use the Selection class to move the cursor in the document. All tables and text will be inserted at Selection.Start.
If you look at the samples, you should get the idea.

Dumas
August 9, 2006, 13:01:32
Ok, it's working.

Thanks.