Разработка информационно-поисковой системы на основе Borland Database Engine, драйвер – Paradox, страница 10

                Range.OlePropertySet("MergeCells",1);

                Range = ExcelApplication.OlePropertyGet("Range", "B2:G2");

                Range.OlePropertySet("MergeCells",1);

                Range = ExcelApplication.OlePropertyGet("Range", "B3:G3");

                Range.OlePropertySet("MergeCells",1);

                for(int i=0;i<Players1->Count;i++)

                {

                        SetCellValue(ExcelApplication, i+6, 2, ((TPlayer*)Players1->Items[i])->Name);

                        SetCellValue(ExcelApplication, i+6, 3, IntToStr(((TPlayer*)Players1->Items[i])->Trows),"0");

                        SetCellValue(ExcelApplication, i+6, 4, IntToStr(((TPlayer*)Players1->Items[i])->Goals),"0");

                        ExcelApplication.OlePropertyGet("Cells", i+6, 5).OlePropertySet("FormulaR1C1","=RC[-1]/RC[-2]");

                        SetCellValue(ExcelApplication, i+6, 6, IntToStr(((TPlayer*)Players1->Items[i])->Selections),"0");

                        SetCellValue(ExcelApplication, i+6, 7, IntToStr(((TPlayer*)Players1->Items[i])->Interceptions),"0");

                        SetCellValue(ExcelApplication, i+6, 8, IntToStr(((TPlayer*)Players1->Items[i])->PlayTime),"0");

                }

                SetCellValue(ExcelApplication, Players1->Count+6, 2, "Суммарные");

                for(int i=3;i<=4;i++)

                {

                        ExcelApplication.OlePropertyGet("Cells", Players1->Count+6, i).OlePropertySet("FormulaR1C1",("=СУММ(R[-"+ AnsiString(Players1->Count) +"]C:R[-1]C)").c_str());

                        ExcelApplication.OlePropertyGet("Cells", Players1->Count+6, i).OlePropertySet("HorizontalAlignment", 3);

                }

                for(int i=6;i<=7;i++)

                {

                        ExcelApplication.OlePropertyGet("Cells", Players1->Count+6, i).OlePropertySet("FormulaR1C1",("=СУММ(R[-"+ AnsiString(Players1->Count) +"]C:R[-1]C)").c_str());

                        ExcelApplication.OlePropertyGet("Cells", Players1->Count+6, i).OlePropertySet("HorizontalAlignment", 3);

                }

                s = "B5:H"+AnsiString(Players1->Count+6);

                range = ExcelApplication.OlePropertyGet("Range", s.c_str());

                for (int i=1; i<=4; i++)

                {

                        range.OlePropertyGet("Borders").OlePropertyGet("Item", i).OlePropertySet("LineStyle", 1);

                }

                // заполнение второго листа

                Sh = ExcelApplication.OlePropertyGet("Worksheets").OlePropertyGet("Item", 2);

                Sh.OlePropertySet("Name", Table3Team2->AsString.c_str());

                ExcelApplication = ExcelApplication.OlePropertyGet("WorkSheets",2);

                SetCellValue(ExcelApplication, 1, 2, "Статистика игроков команды \"" + Table3Team2->AsString + "\"");

                SetCellValue(ExcelApplication, 2, 2, "в матче между \""+ Table3Team1->AsString + "\" и \""+ Table3Team2->AsString + "\"");

                SetCellValue(ExcelApplication, 3, 2, "проведенном "+ Table3Date->AsString);

                SetCellValue(ExcelApplication, 5, 2, "Имя");

                SetCellValue(ExcelApplication, 5, 3, "Количество бросков");

                SetCellValue(ExcelApplication, 5, 4, "Количество голов");