Free Support Forum - aspose.cloud

Error while doing a MailMerge

I have a license to use aspose 9.1, everything always worked fine, I have an application that does a merge WithRegions, but I started having problems with the error:
Found end of mail merge region ‘DADOS’ without matching start.

                for (int i = 0; i < dst.Rows.Count; i++)
                {

                    num++;
                    table.ImportRow(dst.Rows[i]);

                    if (num > num3)
                    {
                          

                            set.Tables.Add(table);
                            DocumentContainer container = DocumentContainer.Load(str2);

                            try
                            {
                               container.MergeWithRegions(set);
                            }
                            catch (Exception ex)
                            {
                                Uteis.GravaLogTxt("MergeWithRegions erro : ", ex.Message);
                            }


                            container.SalvarPdf(string.Concat(new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" }));
                            ApagaPaginasemBranco(string.Concat(new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" }));
                            Uteis.Status(string.Concat(new object[] { "Gerando arquivo ", str3, "_", itens, ".pdf" }), servico);
                            object[] objArray5 = new object[] { AppDomain.CurrentDomain.BaseDirectory, "//Temp//", str3, "_", itens, ".pdf" };
                            list.Add(new Itens(string.Concat(objArray5)));
                     

                            num = 0;
                            itens++;
                            table = new DataTable();
                            table = dst.Clone();
                            table.Clear();
                            set = new DataSet();

                    }
                }

public void MergeWithRegions(DataSet dst)
{
this.Doc.MailMerge.ExecuteWithRegions(dst);
}

@itasouza

This forum is for topics related to Aspose REST APIs whereas your query is relevant to Aspose Native/Downloadable APIs. Please follow this thread https://forum.aspose.com/t/error-while-doing-a-mailmerge/178819 for an answer to your query.