Free Support Forum - aspose.com

Fill table with different rows

I want to crate a table (lets say a list of some items, where each row contains data about item: item id, item name, item price, …). This would be peace of cake for mail merge when executing with region, but the problem is that I need each item in table to be followed by zerro or more additional rows (this additional rows are rows contaning item description).

My table template contains 3 rows: Name of columns, Item data fields, description field

Data can be anything you like (DataSet, multidimensonal string array,…)

Currently i am trying to solve the problem by saving all diferent row types (except the first one), copying them back into table when needed and then manualy searching for fields in inserted row and replacing them with data.

Is there any short cut to do that like eventHandler or smth.?

And one more thing. If i will have to do it like i am doing it now (manualy copying and inserting rows), how can merge fields in each Row when I insert them into table?

Can you please post an example, how to merge all fields in some table Row.

thank you

Yes you can use MailMerge.MergeField event handler to implement any kind of custom data merge logic. See corresponding articles in our programmer's guide and the API reference. There are some examples there too.

Best regards,