There are 3 files in attached archive :
sixAbbottSlides.ppt (1.9Mb) – six last slides from June abbott report
sixAbbottSlides_borders-updated.ppt (0.9Mb) – the same slides, but for each table in this presentation I set borders (for whole table) manually from ‘Borders and Fill’ dialog (no any changes in formatting, just switch borders off and then switch on)
template_slide.ppt – template with one slide – we use it for this slides type.
We are filling this tables in cycles like this:
foreach (RGAbbotReport.AbbottReportRow row in rgdtCorps)
{
line++;
dataTable.GetCell(0, line).TextFrame.Paragraphs[0].Portions[0].Text =
" " + ReportGeneratorFunctions.Corp_Substitutes(row.Corporation).ToUpper();
FillTableRow(line, row, dataTable);
if (row.Corporation.ToLower().IndexOf("abbott") >= 0)
{
for (int j = 0; j < 16; j++)
{
dataTable.GetCell(j, line).FillFormat.Type = FillType.Solid;
dataTable.GetCell(j, line).FillFormat.BackColor = abbotColor;
dataTable.GetCell(j, line).FillFormat.ForeColor = abbotColor;
dataTable.GetCell(j, line).TextFrame.Paragraphs[0].Portions[0].FontColor = Color.White;
}
}
}
Function for fill one table row is :
void FillTableRow(int line, RGAbbotReport.AbbottReportRow row, Table dataTable)
{
//ranks
dataTable.GetCell(1, line).TextFrame.Paragraphs[0].Portions[0].Text = row.RNK_MAT.ToString();
dataTable.GetCell(6, line).TextFrame.Paragraphs[0].Portions[0].Text = row.RNK_YTD.ToString();
if (row.RNK_YTD == 0) dataTable.GetCell(6, line).TextFrame.Paragraphs[0].Portions[0].Text = row.RNK_MTH.ToString();
dataTable.GetCell(11, line).TextFrame.Paragraphs[0].Portions[0].Text = row.RNK_MTH.ToString();
dataTable.GetCell(2, line).TextFrame.Paragraphs[0].Portions[0].Text = FormatSales(row.SALES_MAT);
dataTable.GetCell(7, line).TextFrame.Paragraphs[0].Portions[0].Text = FormatSales(row.SALES_YTD);
dataTable.GetCell(12, line).TextFrame.Paragraphs[0].Portions[0].Text = FormatSales(row.SALES_MTH);
//Share
dataTable.GetCell(4, line).TextFrame.Paragraphs[0].Portions[0].Text = (row.SHARE_MAT).ToString("##0.0");
dataTable.GetCell(9, line).TextFrame.Paragraphs[0].Portions[0].Text = (row.SHARE_YTD).ToString("##0.0");
dataTable.GetCell(14, line).TextFrame.Paragraphs[0].Portions[0].Text = (row.SHARE_MTH).ToString("##0.0");
//growth
dataTable.GetCell(3, line).TextFrame.Paragraphs[0].Portions[0].Text = row.GROWTH_MAT;
dataTable.GetCell(8, line).TextFrame.Paragraphs[0].Portions[0].Text = row.GROWTH_YTD;
dataTable.GetCell(13, line).TextFrame.Paragraphs[0].Portions[0].Text = row.GROWTH_MTH;
//EI
dataTable.GetCell(5, line).TextFrame.Paragraphs[0].Portions[0].Text = row.EI_MAT;
dataTable.GetCell(10, line).TextFrame.Paragraphs[0].Portions[0].Text = row.EI_YTD;
dataTable.GetCell(15, line).TextFrame.Paragraphs[0].Portions[0].Text = row.EI_MTH;
}