PDA

View Full Version : Dynamic Tables merged with WORD Document template


Unregistered
August 9, 2004, 21:00:26
We have a word template that has an area into which we wish to insert a dynamically generated table. In some cases, there will be no data in the table and we will NOT wish to insert the table ... in other instances there will be from one to 10 items in the table.

My first thought was that we would programatically build the table, and then insert the entire table into a BOOKMARK embedded in the Word document ....

... is this the correct approach?

If not, how best can we merge a word document, with dynamic content such as I described above?

Björn Meyer
August 11, 2004, 09:40:33
Hello

If the template contains the table, you have to delete the table, if the table doesn't contain any fields (placeholders).

As you are able to access every table programmatically, you can check whether the table contains data or not. In case, the table contains a field, you can fill out the field with your data. In the other case, you could delete the table.

Of course, you could create the table dynamically using the TableInsert method. In this case, you can insert the table rows on the fly and fill them with data. If you work with templates, I would like to suggest to delete the tables afterwards.

My suggestion: Maybe you can work with a template which contains the tables like a header including a date or a name of the current report.

The additional tables which contains the dynamical data, could be generated on the fly using the TX Text Control methods.