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

                        }

                        if(Flag1 == 1 && Flag2 == 1)

                        {

                                SetCellValue(ExcelApplication,indC1+1,indC2+1,Str);

                        }

                }

 


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

                SetCellValue(ExcelApplication, 1, 2, "Сводная таблица игр сборных");

                Str1 = 'A'+Modulars->Count+1;

                s1 = "B1:" + AnsiString(Str1) + "1";

                range1 = ExcelApplication.OlePropertyGet("Range", s1.c_str());

                range1.OlePropertySet("MergeCells",1);

                tmpStr = 'A'+Modulars->Count+1;

                s = "B2:"+ AnsiString(tmpStr) +IntToStr(Modulars->Count+2);

                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=0;i<Modulars->Count;i++)

                {

                        SetCellValue(ExcelApplication, i+3, 2, ((TCommand*)Modulars->Items[i])->Name);

                        SetCellValue(ExcelApplication, 2, i+3, ((TCommand*)Modulars->Items[i])->Name);

                }

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

                {

                        Table3->RecNo = i;

                        int     tmpC1, tmpC2;

                        int     indC1, indC2;

                        AnsiString      Str;

                        int    Flag1 = 0, Flag2 = 0;

                        tmpC1 = Table3IDTeam1->AsInteger;

                        tmpC2 = Table3IDTeam2->AsInteger;

                        Str = StaticText1->Caption + ":" + StaticText2->Caption;

                        for(int j=0;j<Modulars->Count;j++)

                        {

                                Flag1 = 0;

                                if(((TCommand*)Modulars->Items[j])->ID == tmpC1)

                                {

                                        indC1 = ((TCommand*)Modulars->Items[j])->Ind1;

                                        Flag1 = 1;

                                        break;

                                }

                        }

                        for(int j=0;j<Modulars->Count;j++)

                        {

                                Flag2 = 0;

                                if(((TCommand*)Modulars->Items[j])->ID == tmpC2)

                                {

                                        indC2 = ((TCommand*)Modulars->Items[j])->Ind1;

                                        Flag2 = 1;

                                        break;

                               }

                        }

  if(Flag1 == 1 && Flag2 == 1)

                        {

                                SetCellValue(ExcelApplication,indC1+1,indC2+1,Str);

                        }

                }

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

                {

                        delete (TCommand*)Commands->Items[i];

                }

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

                {

                        delete (TCommand*)Modulars->Items[i];

                }

                delete Commands;

                delete Modulars;

        }

        catch(...)

        {

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

        }

}

Общая таблица матчей