@@ -14,10 +14,6 @@ static void Main(string[] args)
1414 //Opens the template document.
1515 using ( WordDocument document = new WordDocument ( fileStream , FormatType . Dotm ) )
1616 {
17- //Gets the table.
18- DataTable table = GetDataTable ( ) ;
19- //Executes Mail Merge with groups.
20- document . MailMerge . ExecuteGroup ( table ) ;
2117 //Creates file stream.
2218 using ( FileStream outputFileStream = new FileStream ( Path . GetFullPath ( @"../../../Result.docm" ) , FileMode . Create , FileAccess . ReadWrite ) )
2319 {
@@ -27,29 +23,5 @@ static void Main(string[] args)
2723 }
2824 }
2925 }
30-
31- private static DataTable GetDataTable ( )
32- {
33- //List of syncfusion products name.
34- string [ ] products = { "DocIO" , "PDF" , "XlsIO" } ;
35- //Adds new Tables to the data set.
36- DataRow row ;
37- DataTable table = new DataTable ( ) ;
38- //Adds fields to the Products table.
39- table . TableName = "Products" ;
40- table . Columns . Add ( "ProductName" ) ;
41- table . Columns . Add ( "Binary" ) ;
42- table . Columns . Add ( "Source" ) ;
43- //Inserts values to the tables.
44- foreach ( string product in products )
45- {
46- row = table . NewRow ( ) ;
47- row [ "ProductName" ] = string . Concat ( "Essential " , product ) ;
48- row [ "Binary" ] = "$895.00" ;
49- row [ "Source" ] = "$1,295.00" ;
50- table . Rows . Add ( row ) ;
51- }
52- return table ;
53- }
5426 }
5527}
0 commit comments