Table Fonts issue


#1

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?


#2

Hello papaboom.

I failed to reproduce this issue. Please check fonts in your template table, maybe you’re using in problematic cells some different font which doesn’t clearly differs in normal and bold states?

If this won’t help, please send us template presentation and code you are using to create table.


#3

Thanks for the reply - this is mostly dynamically generated - there is no table template to speak of - only a presentation with a single slide - the font is the same throughout (Times New Roman) size 10..

The bold fonts come out in all the wrong places.. I will double check my code - as of right now it's not production worthy and mainly just experimenting with the Aspose.Powerpoint component.. If I cant clear it up - I will try and post again with more specifics.. Thanks for the response.