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

                SetCellValue(ExcelApplication, 5, 5, "Процентаж");

                SetCellValue(ExcelApplication, 5, 6, "Количество подборов");

                SetCellValue(ExcelApplication, 5, 7, "Количество перехватов");

                SetCellValue(ExcelApplication, 5, 8, "Время в игре (мин)");

                Range = ExcelApplication.OlePropertyGet("Range", "B1:G1");

                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<Players2->Count;i++)

                {

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

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

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

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

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

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

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

                }

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

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

                {

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

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

                }

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

                {

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

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

                }

                s = "B5:H"+AnsiString(Players2->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);

                }

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

                {

                        delete (TPlayer*)Players1->Items[i];

                }

                for(int i=Players2->Count-1;i>=0;i--)

                {

                        delete (TPlayer*)Players2->Items[i];

                }

                delete  Players1;

                delete  Players2;

        }

        catch(...)

        {

                Application->MessageBox("Ошибка создания отчёта. Проверьте состояния фильтров.","Ошибка",MB_OK+MB_ICONERROR);

        }

}

Статистика игроков за сезон