I have the following code, I’m trying everything to format it but it still comes up in the DEFAULT Red with a large font. What am I doing wrong?
thanks again
int j = 0; // ROW
foreach(RowEx r in newTable.Rows)
{
for (int i = 0; i < 6; i++)
{
CellEx c = r[i];
c.BorderRight.FillFormat.FillType = FillTypeEx.Solid;
c.BorderRight.FillFormat.SolidFillColor.Color = Color.Gray;
c.BorderTop.Width = 1;
c.BorderBottom.Width = 1;
c.BorderLeft.Width = 1;
c.BorderRight.Width = 1;
c.TextFrame.Paragraphs[0].Portions[0].PortionFormat.LatinFont = new FontDataEx(“Arial”);
c.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 9;
TextFrameEx tfex = c.TextFrame;
// tfex.Paragraphs[0].Portions[0].Text = "Cell no " + (j ) + " " + (i);
tfex.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 9;
tfex.Paragraphs[0].Portions[0].PortionFormat.LatinFont = new FontDataEx(“Arial”);
// Columns
if (i == 0 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = lstGPD[j - 1].MaterialCategoryName;
}
else if (i == 1 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = lstGPD[j - 1].MaterialName;
}
else if (i == 2 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = lstGPD[j - 1].Mass.ToString();
}
else if (i == 3 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = lstGPD[j - 1].UnitName;
}
else if (i == 4 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = Math.Round(GreenPrintCalculations.Convert_To_GSM(lstGPD[j - 1]),6).ToString();
}
else if (i == 5 && j > 0)
{
tfex.Paragraphs[0].Portions[0].Text = lstGPD[j - 1].Material.Reference;
}
// Row 0 HEADINGs
if (j == 0)
{
if (i == 0)
{
if (_baseline)
tfex.Paragraphs[0].Portions[0].Text = “Baseline”;
else
tfex.Paragraphs[0].Portions[0].Text = “Redesigned”;
}
else if (i == 1)
{
tfex.Paragraphs[0].Portions[0].Text = “Material Type”;
}
else if (i == 2)
{
tfex.Paragraphs[0].Portions[0].Text = “Mass/Density”;
}
else if (i == 3)
{
tfex.Paragraphs[0].Portions[0].Text = “Unit”;
}
else if (i == 4)
{
tfex.Paragraphs[0].Portions[0].Text = “gsm”;
}
else if (i == 5)
{
tfex.Paragraphs[0].Portions[0].Text = “Data Reference”;
}
}
}
foreach (CellEx cell in r)
{
cell.TextFrame.Paragraphs[0].Portions[0].PortionFormat.LatinFont = new FontDataEx(“Arial”);
cell.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 9;
cell.BorderTop.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderTop.FillFormat.SolidFillColor.Color = Color.Gray;
cell.BorderTop.Width = 1;
cell.BorderBottom.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.Gray;
cell.BorderBottom.Width = 1;
cell.BorderLeft.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.Gray;
cell.BorderLeft.Width = 1;
cell.BorderRight.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderRight.FillFormat.SolidFillColor.Color = Color.Gray;
cell.BorderRight.Width = 1;
}
j++;
}
}