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

                tmpIndex1 = Table3IDTeam1->AsInteger;

                tmpIndex2 = Table3IDTeam2->AsInteger;

                tmpIndex4 = Table3ID->AsInteger;

                if(tmpIndex1 == tmpIndex2)

                {

                        Application->MessageBox("Матчей команды с собой не бывает.","Ошибка",MB_OK+MB_ICONERROR);

                        return;

                }

                AnsiString      filter = Table5->Filter;

                Table5->Filtered = false;

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

                {

                        Table5->RecNo = i;

                        if(Table5IDMatch->AsInteger == tmpIndex4)

                        {

                                TPlayer *tmpRec = new TPlayer;

                                tmpRec->Name = Table5Name->AsString;

                                tmpRec->ID = Table5IDPlayer->AsInteger;

                                tmpRec->IDTeam = Table5IDTeam->AsInteger;

                                tmpRec->Trows = Table5Trows->AsInteger;

                                tmpRec->Selections = Table5Selections->AsInteger;

                                tmpRec->Interceptions = Table5Interceptions->AsInteger;

                                tmpRec->PlayTime = Table5PlayTime->AsInteger;

                                if(Table5IDTeam->AsInteger == tmpIndex1)

                                        Players1->Add(tmpRec);

                                if(Table5IDTeam->AsInteger == tmpIndex2)

                                        Players2->Add(tmpRec);

                                tmpCh = 0;

                                Table4->First();

                                while(!Table4->Eof)

                                {

                                        if(Table4IDMatch->AsInteger == tmpIndex4 && Table4IDPlayer->AsInteger == tmpRec->ID)

                                        {

                                                tmpCh++;

                                        }

                                        Table4->Next();

                                }

                                tmpRec->Goals = tmpCh;

                        }

                }

                Table5->Filter = filter;

                Table5->Filtered = true;

                Variant ExcelApplication = InitExcel(2);

ExcelApplication.OlePropertySet("Visible",true);

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

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

                SetCellValue(ExcelApplication, 1, 2, "Статистика игроков команды \"" + Table3Team1->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, "Количество голов");

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

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

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

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

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