hi all...
for(int x = 0; x < rows; x++){
Document doc = new Document(Server.MapPath("Dot/Report.dot"));
int pickOrderId = int.Parse(dt.Rows[x].ItemArray.GetValue(0).ToString());
object[] parameters = {pickOrderId};
DataTable dtRow = SqlHelper.ExecuteDataset(cn, "SelectPickOrderLineByForeignKey_Cs", parameters).Tables[0];
dtRow.TableName = "PickOrderLine";
doc.MailMerge.ExecuteWithRegions(dtRow);
doc.MailMerge.Execute(dt.Rows[x]);
doc.Save(Server.MapPath("Dot/" + dt.Rows[x].ItemArray.GetValue(1).ToString() + ".doc"));
}
this code create a doc file foreach row, but if i want to create only one doc file and add a new page foreach row in my DataTable what can i do?
Example:
MyDataTable.Rows.Count --> 12
My code create 12 doc file (Doc1.doc, Doc2.doc, etc...)
What can I create a page into a doc file for any lap of my "For"?
THANKS!