Hi,
Unfortunatly, it didn’t work. The styling of the table is not correctly print (Text is not center in all cell, text in bold style in certain cell )
In the file behind (result.pdf), you can see that the two first rows did’nt correctly print. I expect to have the style like the thirs row.
AsposeStyling.zip (40.4 KB)
Thanks in advance.
A new version of the code to get my file (result.pdf).
foreach (Run run in template.GetChildNodes(NodeType.Run, true))
{
//run.Font.ClearFormatting();
run.Font.Size = 10;
run.Font.Name = "Raleway";
run.Font.Color = Color.FromArgb(118, 113, 113);
}
DataTable table = new DataTable("Test");
table.Columns.Add("Date");
table.Columns.Add("Type");
table.Columns.Add("Occupation");
table.Columns.Add("Pieces");
table.Columns.Add("Niveaux");
table.Columns.Add("SurfaceF");
table.Columns.Add("SurfaceTerrainF");
table.Columns.Add("EpoqueConst");
table.Columns.Add("Adresse");
table.Columns.Add("CodePostal");
table.Columns.Add("Commune");
table.Columns.Add("PrixM2");
table.Columns.Add("MontantF");
table.Rows.Add(new object[] { "02/12/2015", "Villa", "Bien Libre", "4", "3", "84 m2", "144m2", "De 1981 à 2012", "14 RUE DE RIVOLI", "75015", "Paris", "7982€", "1 000 000€" });
table.Rows.Add(new object[] { "02/12/2015", "Villa", "Bien Libre", "5", "3", "84 m2", "144m2", "De 1981 à 2012", "14 RUE DE RIVOLI", "75015", "Paris", "7982€", "1 000 000€" });
table.Rows.Add(new object[] { "02/12/2015", "Villa", "Bien Libre", "5", "3", "84 m2", "144m2", "De 1981 à 2012", "14 RUE DE RIVOLI", "75015", "Paris", "7982€", "1 000 000€" });
template.MailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveUnusedFields | MailMergeCleanupOptions.RemoveUnusedRegions;
template.MailMerge.Execute(new string[] { "Count" }, new object[] { 1 });
template.MailMerge.RemoveEmptyParagraphs = true;
template.MailMerge.ExecuteWithRegions(table);
template.UpdateFields();