private void MergeKeyRatio_ComprasionColumnCells(Table table, Document doc) { try { Cell secondRowLastCell = null; Cell lastRowLastCell = null; if (table.Rows.Count > 1) { Row secondRow = table.Rows[1]; secondRowLastCell = secondRow.Cells[secondRow.Cells.Count - 1]; Row lastRow = table.Rows[table.Rows.Count - 1]; if (lastRow.Cells.Count > 0) { lastRowLastCell = lastRow.Cells[lastRow.Cells.Count - 1]; } } if (secondRowLastCell != null && lastRowLastCell != null) { MergeCells(secondRowLastCell, lastRowLastCell); Aspose.Words.Run run = new Aspose.Words.Run(doc); if (SpecialNoteKeyValue["KeyRatioComparisonText"] != null) { run.Text = SpecialNoteKeyValue["KeyRatioComparisonText"].ToString(); } secondRowLastCell.FirstParagraph.RemoveAllChildren(); secondRowLastCell.FirstParagraph.AppendChild(run); } } catch (Exception ex) { //logger.Error(ex); if (HttpContext.Current.Session["Error"] != null && !string.IsNullOrEmpty((string)HttpContext.Current.Session["Error"])) { HttpContext.Current.Session["Error"] = "Error occured while merging 'Comprasion' Column Cells of MergeKeyRatio node || " + (string)HttpContext.Current.Session["Error"]; } else { HttpContext.Current.Session["Error"] = "Error occured while merging 'Comprasion' Column Cells of MergeKeyRatio node || " + ex.Message; } throw ex; } }
public void AddBlankPage(int count) { if (count > 0) { AW.Paragraph par = null; AW.Run run = null; for (int i = 0; i < count; i++) { par = new AW.Paragraph(wDoc); run = new AW.Run(wDoc, AW.ControlChar.PageBreak); par.AppendChild(run); wDoc.LastSection.Body.AppendChild(par); } } }