Free Support Forum - aspose.com

How do I read a table on the word document. Can you please send me snippet of code

hi,

How do i create table in the word document. in c# asp.net. i have to create table for every row in the datatable. table should display columns as rows and that data should be after that...

like

Column 1: data

Column 2 : data

Column 3: data.

shall i create table using table object of aspose.. like

doc.FirstSection.Body.Tables[0]...

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. As I suggested earlier in the following thread you should use mail merge with regions.

http://www.aspose.com/community/forums/thread/131594/inserting-many-tables-like-following.aspx

You should create template like the following

«TableStart:myTable»

First name

«FirstName»

Last name

«LastName»

Company

«Company»

«TableEnd:myTable»

Then you should execute mail merge with regions. DataTable that you use as data source should have name “myTable”. And this table should contains columns with names FirstName, LastName and Company

Best regards.

hi Alexey,

i might have 1000 pages like above for every page i have to create one table and that data. will that table automatically created when we use mailmerge. because for every row ihave tocreate a table. otherwise shall i create table before mail merge in every page. if so i dont know how many rows i will get into my dataset or datatable......... can you please clear my doubt ....

thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. In your template should be only one table that contains mergefields. During mail merge this table will be repeated automatically for each record. Take a look the provided example and you will see this behavior.

Best regards.