Hi Denis,
You shall make use of Mail merge event functionality to process data during mail merge. Please refer to the following online sample of mail merge event functionality from the following link.
Online sample link:
http://asp.syncfusion.com/demos/web/docio/mailmergeevent.aspx
Kindly use the below code to retrieve the count or sum of records based on gender using mail merge event handler:
int maleCount = 0;
int femaleCount = 0;
document.MailMerge.MergeField += new MergeFieldEventHandler(GetCount);
document.MailMerge.ExecuteNestedGroup(dataSet, commands);
static void GetCount(object sender, MergeFieldEventArgs args)
{
if (args.FieldName == "Gender")
{
if (args.FieldValue == "Male")
maleCount++;
else
femaleCount++;
}
}
Regards,
Sathish
Hi Denis,
Please ignore our previous update.
You shall make use of Mail merge event functionality to process data during mail merge. Please refer to the following online sample of mail merge event functionality from the following link.
Online sample link:
http://asp.syncfusion.com/demos/web/docio/mailmergeevent.aspx
Kindly use the below code to retrieve the count or sum of records based on gender using mail merge event handler:
int maleCount = 0;
int femaleCount = 0;
document.MailMerge.MergeField += new MergeFieldEventHandler(GetCount);
document.MailMerge.ExecuteNestedGroup(dataSet, commands);
static void GetCount(object sender, MergeFieldEventArgs args)
{
if (args.FieldName == "Gender")
{
if (args.FieldValue == "Male")
maleCount++;
else
femaleCount++;
}
}
If you have any complex formulae values to be calculated then you shall make use of our Essential XlsIO control by importing values on the cells to compute the values. Please refer to the below online sample link to know about formula support in XlsIO.
Online sample link:
http://asp.syncfusion.com/demos/web/xlsio/formulas.aspx
Regards,
Sathish
Hi Denis,
Please ignore our previous update.
You shall make use of Mail merge event functionality to process data during mail merge. Please refer to the following online sample of mail merge event functionality from the following link.
Online sample link:
http://asp.syncfusion.com/demos/web/docio/mailmergeevent.aspx
Kindly use the below code to retrieve the count or sum of records based on gender using mail merge event handler:
int maleCount = 0;
int femaleCount = 0;
document.MailMerge.MergeField += new MergeFieldEventHandler(GetCount);
document.MailMerge.ExecuteNestedGroup(dataSet, commands);
static void GetCount(object sender, MergeFieldEventArgs args)
{
if (args.FieldName == "Gender")
{
if (args.FieldValue == "Male")
maleCount++;
else
femaleCount++;
}
}
If you have any complex formulae values to be calculated then you shall make use of our Essential XlsIO control by importing values on the cells to compute the values. Please refer to the below online sample link to know about formula support in XlsIO.
Online sample link:
http://asp.syncfusion.com/demos/web/xlsio/formulas.aspx
Regards,
Sathish
{
args.CurrentRow.AddColumn("number").GetValue(args.RowIndex + 1);
}{
args.CurrentRow.GetColumn("number").SetValue(args.RowIndex + 1);
}Hi Denis,
Thank you for your update.
On further analyzing the given details, we found that you are trying to update the sequence number value for each merged record. To archive this requirement, you don’t need to use the mail merge events to update the sequence number instead you can use the merge sequence field for this purpose. For your reference we have prepared the sample to update the sequence number for each merge record during mail merge process. Please find the sample from the following link:
http://www.syncfusion.com/downloads/support/forum/120727/ze/GenerateWord-1644113451.zip
If we misunderstood your requirement, kindly elaborate your requirement with clear description (like screenshot of your output or expected output document), Thereby we will analyse further on your requirement and update you appropriate solution at the earliest
Please let us know if you have any other queries.
Regards,
Sarath