hi - I am using bookmarks to insert data into ms word. Everything works fine until I use this (commented out because it affects all the other tables in the same and subsequent documents)
Could you tell me why please?
// //builder.MoveToBookmark(bookMark);
// Aspose.Words.Tables.Table table = doc.document.FirstSection.Body.Tables[2];
// int additionalRows = aDs.Tables[0].Rows.Count - table.Rows.Count + 1;
// if (additionalRows > 0)
// {
// for (int i = 0; i < additionalRows; i++)
// {
// Aspose.Words.Tables.Row clonedRow = (Aspose.Words.Tables.Row)table.LastRow.Clone(true);
// foreach (Cell cell in clonedRow.Cells)
// {
// cell.RemoveAllChildren();
// cell.EnsureMinimum();
// }
// table.Rows.Add(clonedRow);
// }
// }
// foreach (Cell cell in table.LastRow.Cells)
// {
// cell.CellFormat.Borders.Bottom.LineStyle = Aspose.Words.LineStyle.Thick;
// cell.CellFormat.Borders.Bottom.LineWidth = 1.5;
// }
// for (int row = 0; row < aDs.Tables[0].Rows.Count; row++)
// {
// string tradeDate = DateTime.Parse(aDs.Tables[0].Rows[row]["trade_date"].ToString()).ToString("dd-MMM-yyyy");
// string inflow = Math.Abs(Double.Parse(aDs.Tables[0].Rows[row]["flow"].ToString())).ToString("###,###,###,##0");
// string flowType = aDs.Tables[0].Rows[row]["trans_type"].ToString();
// builder.MoveToCell(2,row+1,0,-1); // move to the beginning of the cell
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.InsertHtml(tradeDate, true);
// if (flowType == "SUBSCRIPTION")
// {
// builder.MoveToCell(2, row + 1, 1, -1);
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.MoveToCell(2, row + 1, 2, -1);
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.InsertHtml("N/A", true);
// }
// else
// {
// builder.MoveToCell(2, row + 1, 1, -1);
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.InsertHtml("N/A", true);
// builder.MoveToCell(2, row + 1, 2, -1);
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.InsertHtml(inflow, true);
// }
// }
// }
// else
// {
// for (int col = 0; col < 3; col++)
// {
// builder.MoveToCell(2, 0, col, 0); // move to the beginning of the cell
// builder.Font.Name = "Arial";
// builder.Font.Size = 10;
// builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Center;
// builder.InsertHtml("N/A", true);
// }
// }
//}
//builder.CellFormat.ClearFormatting();
//builder.ParagraphFormat.ClearFormatting();