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

void __fastcall TFormMain::N9Click(TObject *Sender)

{

        try

        {

                SaveFilterState();

                int     Index=0;

                int     ChGoals1, ChGoals2;

                int     tmpIDPlayer;

 int     tmpIDTeam;

                int     tmpIDTeam1;

                int     tmpIDTeam2;

                int     tmpIDMatch;

                int     tmpIDStat;

                int     tmpIDGoal;

                TStatPlayer     Player;

                Variant Range;

                for(int i=1;i<=Table1->RecordCount;i++)

                {

                        Table1->RecNo = i;

                        if(Table1Name->AsString.AnsiPos("Сборная") == 0)

                        {

                                Index+=1;

                        }

                }

                Variant ExcelApplication = InitExcel(Index);

                ExcelApplication.OlePropertySet("Visible",true);

                Index = 0;

                for(int i=1;i<=Table1->RecordCount;i++)

                {

                        Table1->RecNo = i;

                        if(Table1Name->AsString.AnsiPos("Сборная") == 0)

                        {

                                Index += 1;

                                tmpIDTeam = Table1ID->AsInteger;

                                ExcelApplication.OlePropertyGet("Worksheets").OlePropertyGet("Item", Index).OlePropertySet("Name", Table1Name->AsString.c_str());

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 1, 2, "Общая статистика игроков команды");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "B1:L1").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 2, 2, "\"" + Table1Name->AsString + "\"");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "B2:L2").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 3, 2, "по всем проведенным играм");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "B3:L3").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 5, 2, "Имя");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "B5:B6").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 5, 3, "Игры за клуб");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "C5:G5").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 5, 8, "Игры за сборную");

                                ExcelApplication.OlePropertyGet("Worksheets",Index).OlePropertyGet("Range", "H5:L5").OlePropertySet("MergeCells",1);

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 6, 3, "Количество бросков");

                                SetCellValue(ExcelApplication.OlePropertyGet("Worksheets",Index), 6, 8, "Количество бросков");