I have a routine I call to populate and format tables on a per cell basis with the following code (in c#):
private void InsertPptCell(int Row, int Column, object Value, bool isHeader, Aspose.PowerPoint.TextAlignment align)
{
Aspose.PowerPoint.TextFrame tf = pptTable.GetCell (Column,Row).TextFrame;
Aspose.PowerPoint.Paragraph para = tf.Paragraphs[0];
Aspose.PowerPoint.Portion port = para.Portions[0];
Aspose.PowerPoint.Cell cell1 = pptTable.GetCell(Column, Row);
cell1.BorderBottom.LineFormat.ShowLines = false;
cell1.BorderLeft.LineFormat.ShowLines = false;
cell1.BorderRight.LineFormat.ShowLines = false;
cell1.BorderTop.LineFormat.ShowLines = false;
port.FontHeight = 9;
port.FontBold = isHeader;
para.Alignment = align;
port.Text = Value.ToString();
}
The following code makes multiple calls to the one above:
InsertPptCell(0, 0, "Opportunity:", true, TextAlignment.Left);
InsertPptCell(1, 0, "Phase:", true, TextAlignment.Left);
InsertPptCell(2, 0, "Checklist Type:", true, TextAlignment.Left);
InsertPptCell(0, 1, _opportunity.Name, false, TextAlignment.Left);
InsertPptCell(1, 1, _opportunity.Phase, false, TextAlignment.Left);
InsertPptCell(2, 1, _opportunity.ChecklistType, false, TextAlignment.Left);
InsertPptCell(0, 2, "Entered:", true, TextAlignment.Left);
InsertPptCell(1, 2, "Close/Award:", true, TextAlignment.Left);
InsertPptCell(2, 2, "Value:", true, TextAlignment.Left);
InsertPptCell(0, 3, _opportunity.Entered, false, TextAlignment.Left);
InsertPptCell(1, 3, _opportunity.Closed, false, TextAlignment.Left);
InsertPptCell(2, 3, _opportunity.Amount, false, TextAlignment.Left);
Yet for whatever reason the "port.FontBold = isHeader;" in the InsertPptCell routine is only working for the "Opportunity:" and "Entered:" table entries - the other items ("Close/Award:", "Value", "Phase:", "Checklist Type:") are not bold (though the .FonetBold property is being set to true..)
What am I doing wrong here?
|