I will attach the template again. But it seems I have a requirements as second table show below. Currently also all new tables add a space after each row.
- Currently Printing as: -
|Combined %|CRSC Effective Date|
|—|---|
|100|Jun 2021|
|80|March 2021|
A CH61 APPROVAL (KL) (7) (1).docx (87.4 KB)
But we want it as attached template actually. I have highlighted the table for you in 2nd document. A CH61 Approval (KL) (7)(1).docx has the example
@vlbuch23 Could you please attach your template (input document)? The document you have attached is the output document produced after executing mail merge.
Sure below is the input document
A CH61 APPROVAL (KL) (8).docx (88.1 KB)
@vlbuch23 Thank you for additional information. I have tested your template with dummy data and as I can see each record is put into a separate row in the table as it is expected. Here is test code I used:
DataTable dt = new DataTable("DateRanges");
dt.Columns.Add("CombDisaPctRnd");
dt.Columns.Add("vasrdstartdate2");
dt.Rows.Add("test", "test");
dt.Rows.Add("test", "test");
dt.Rows.Add("test", "test");
dt.Rows.Add("test", "test");
Document doc = new Document(@"C:\Temp\in.docx");
doc.MailMerge.MergeDuplicateRegions = true;
doc.MailMerge.ExecuteWithRegions(dt);
doc.Save(@"C:\Temp\out.docx");
And here is the table generated by this code:
So I wanted for only this table. I wanted to insert in one cell. So dont want the data to be in next cell.
I hope this clarifies. By reading this it sounds like this is adding new cell record.
Attaching a snippet. Data populates fine. Thats not a problem. Its just the format style I am looking for.
@vlbuch23 I think, in your case, you can simply disable horizontal border between the data rows in your template. In this case the output will look like this:
Here is the modified template: in.docx (88.4 KB)
Thanks alexey. Can you share screen shot or steps how did it. Because I have about 15 templates to modify.
Thanks
Surbhi
@vlbuch23 Select whole table and disable all borders:
Then select the table and enable only outer border: