How do i repeat template with new data

This is not the solution.
We can’t change any cell width and height.Template should remain Fixed.
What you have suggested if we add more trade names then Cell start expanding which is not desirable.
Suppose few Trade Names added to your code then Cell starts Expanding but idealy table template should go to next page with overflow data.
If you have refer the two documents(WantedOutput.doc , ExistingOutput.doc) which i had attached then you can understand the problem.
ExistingOutput.doc is what that you have suggested.(if TradeName increases then Cell starts expanding, which is not desirable)
WantedOutput.doc is what i required.(If TradeName increase the whole template is repeat with overflow data)
Please go through the both documents and table which i have given to you in last posts to properly understand the problem.
This becomes a very hot issue for our project.kindly give some good attention to it.
Thanks.

Hi

I have seen these documents. And I think that I cannot help you further. To be able to help you I need to have code that you use to perform mail merge, some data that you use and your template but not the result document. Right now I can see no way how I can help you.

Best regards,

Please find the code…

DataTable table = new DataTable("table");
table.Columns.Add("Trade");
table.Columns.Add("GenericName");
table.Columns.Add("Date");
table.Columns.Add("Date2");
DataRow row = table.NewRow();
row[0]=@"Trade1\nTrade2\nTrade3\nTrade4\nTrade5\nTrade6\n
Trade7\nTrade8\nTrade9\nTrade10\nTrade11\nTrade12\nTrade13\nTrade14\nTrade15\nTrade16\nTrade17";
row[1] = "Generic1\nGeneric2";
row[2] = DateTime.Now.ToString();
row[3] = DateTime.Now.ToString();
table.Rows.Add(row);
DataRow row1 = table.NewRow();
row1[0]= "Trade Special";
row1[1] = "Generic Special";
row1[2] = DateTime.Now.ToString();
row1[3] = DateTime.Now.ToString();
table.Rows.Add(row1);
//open template document
Document doc = new Document(@"Template.doc");
//execute mailmerge
doc.MailMerge.ExecuteWithRegions(table);
//save result.
doc.Save(@"ExistingOutput.doc");

I have attached Template.doc in this post and for ExistingOutput.doc you can refer my last post in this series.
For WantedOutput.doc you can refer last to last post.

Hi
Please reattach your template.
Best regards.

I have attached the Template in last post.

Hi
Yes, I see attachment now. Unfortunately, I can’t help you with this issue. It is not trivial task. It’s impossible to determine whether the text will fit in the cell or not. You can manually calculate how much rows can be inserted into the cell and split your data before mail merge. Also see the following link. Maybe this information will help you to find solution.
Best regards.

A post was split to a new topic: Perform mail merge with data