Hi
am using mail merge and i have a word template .In the template first two rows are header and i given "Repeat as header row at the top of each page" property also,but its not working.Here by am attacting my Template and code also please have a look on that and let me wht am doing wrong.
public void WordHeaderRepeat()
{
try
{
Aspose.Words.Document objWordDoc = new Document(@"C:\Documents and Settings\amj001\Desktop\Header.doc");
DataTable dtReportData = new DataTable();
DataRow dr;
dtReportData.Columns.Add("Date");
dtReportData.Columns.Add("One", typeof(System.Double));
dtReportData.Columns.Add("Two", typeof(System.Double));
dtReportData.Columns.Add("Three", typeof(System.Double));
dtReportData.Columns.Add("Four", typeof(System.Double));
dtReportData.Columns.Add("Five", typeof(System.Double));
dtReportData.Columns.Add("Six", typeof(System.Double));
dtReportData.Columns.Add("Seven", typeof(System.Double));
for (int rowcnt = 0; rowcnt < 100; rowcnt++)
{
dr = dtReportData.NewRow();
dr[0] = "12/12/2012";
for (int colcnt = 1; colcnt <= 7; colcnt++)
{
dr[colcnt] = "1000000000";
}
dtReportData.Rows.Add(dr);
}
if (dtReportData.Rows.Count > 0)
{
dtReportData.TableName = "ReportTable";
objWordDoc.MailMerge.ExecuteWithRegions(dtReportData);
objWordDoc.UpdateFields();
if (File.Exists(@"C:\Documents and Settings\amj001\Desktop\HeaderOut.pdf"))
{
File.Delete(@"C:\Documents and Settings\amj001\Desktop\HeaderOut.pdf");
}
objWordDoc.Save(@"C:\Documents and Settings\amj001\Desktop\HeaderOut.pdf");
}
else
{
}
}
catch (Exception ex)
{
}
}