Да посрочном, потому что мне нужно почти все форматировать посвоему. (к сожолению)
Код: Выделить всё
      EXLClass.Init(true,false,true)
      EXLClass.OpenWorkbook(Glo:ExcelFileName,false,,,false)
      Loc:ExcelStarted = 1
      Do Main
Main Routine
 EXLClass.Visible(false)
  If Loc:Main_Games = 1 Then Do Print_Main_Games.
Print_Main_Games Routine
  Clear(Under)
  EXLClass.SelectSheet(1);  R=6
  LIS:PNumber = Glo:ProgN; LIS:TNumber = 1;
  HeadC = 0; HeadS = 0
  Set(LIS:KeyPTNumber,LIS:KeyPTNumber)
  Loop 
     Next(Listi)
     If errorcode() or LIS:PNumber <> Glo:ProgN Then Break.
     If LIS:Shedegi <> '...' Or LIS:Gad <> 0 Then Cycle.
     if lis:date < Today() or (lis:date = Today() and lis:TIme < clock()) then cycle.
     If Loc:FromCode1 <> 0 Then
        If LIS:TNumber < Loc:FromCode1 Then Cycle.
        If LIS:TNumber > Loc:ToCode1 Then Cycle.
     End
     case Lis:Status
     of 'B' orof 'N' orof 'L'
        Cycle
     .
     Case Lis:Status
     Of '1' Orof '2' Orof '3' orof 'P'
        If (HeadS <> LIS:SpecHeadCode) Or ((LIS:HeadCode<>0) And (LIS:HeadCode <> HeadC)) Or (LIS:LStat[1] = 1) Then
           Do PrintHead
           HeadC = LIS:HeadCode; HeadS = LIS:SpecHeadCode
        .
     Else
       If HeadC <> LIS:HeadCode Then
          Do PrintHead
          HeadC = LIS:HeadCode
       .
     End
     Do ReformatRow
  End
  If R > Sav:S_Row Then
     EXLClass.SelectRange(Sav:S_Row,1,R,Sav:With); EXLClass.DrawTable(BoxMode:Table,LineStyle:Dash,BorderWeight:Hairline)
  .
  Loop j=1 To 5000
     if Under[j]=1 Then
        EXLClass.SelectRange(j,1,j,3)
        EXLClass.SetBorder(Border:EdgeBottom,LineStyle:Continuous,BorderWeight:Medium)
  .  .
  
 PrintHead Routine
   Case LIS:Status
   Of 'M' orof 'P'
      Do HPrintM
   Of 'H' Orof 'B'
      Do HPrintH
   Of 'T'
      Do HPrintT
   Of 'N'
     Do Hprinttennis
   Of '1' Orof '2' Orof '3'
     Do HPrint1
   End
ReformatRow Routine
   Case LIS:Status
   Of 'M' orof 'P'
    Do ReformatM
   Of 'T' Orof 'H' OrOf 'B'
    Do ReformatT
   Of 'N'
    Do ReformatTennis
   Of '1' Orof '2' orof '3'
    Do Reformat6
   End
 
 
 
HPrintM Routine
  Do GetDivName; Do PrintMainHeader
     NN=Lis:Status
     Do HCodi_Teams
     EXLClass.WriteRow(R,6,'1,X,2,1X,X2,12'); EXLClass.SetFont('Arial',8,,Font:Bold)
     EXLClass.WriteRow(R,12,'meti,tot.,nakl'); EXLClass.SetFont('LitNusx',8,,Font:Bold);
     EXLClass.WriteRow(R,15,'(0)1,(0)2'); EXLClass.SetFont('Arial',8,,Font:Bold)
     EXLClass.WriteRow(R,17,'ki,ara'); EXLClass.SetFont('LitNusx',8,,Font:Bold);
     Sav:B_D = R-1
	 
PrintMainHEader Routine                                                                                         !
  EXLClass.SelectRange(R,1,R,18);  EXLClass.SetFont(Glo:Header_Font,Glo:Header_Font_Syze,);
  EXLClass.SelectRange(R,1,R,5);   EXLClass.Mergecells; EXLClass.SetFont(Glo:Div_Font,Glo:Div_Font_Syze, COLOR:Black, Glo:Div_Font_Style);
                                                        Do Format_STR
                                                        EXLClass.Write(R,1,Clip(Loc:HeadM))
                                                        if str_Yes then do set_font_div.
     EXLClass.SelectRange(R,6,R,8);   EXLClass.Mergecells; EXLClass.Write(R,6,'ZiriTadi')
     EXLClass.SelectRange(R,9,R,11);  EXLClass.Mergecells; EXLClass.Write(R,9,'saSualo')     
     EXLClass.SelectRange(R,12,R,14); EXLClass.Mergecells; EXLClass.Write(R,12,'burTebi')
     EXLClass.SelectRange(R,15,R,16); EXLClass.Mergecells; EXLClass.Write(R,15,'freze gayra')
     EXLClass.SelectRange(R,17,R,18); EXLClass.Mergecells; EXLClass.Write(R,17,'2-gaitans')
     EXLClass.SelectRange(R,6,R,18);  EXLClass.SetFont(Glo:Header_Font,Glo:Header_Font_Syze,,Font:Bold)
	 
!********* Reformat MAin **************************************************************!
ReformatM Routine                                                                      !
 Do ClaFormatM; Do RCodi_Teams                                                         !
  EXLClass.Write(R,6, Left(Clip(L:W)),True);    EXLClass.Write(R,7, Left(Clip(L:X)),True);   EXLClass.Write(R,8, Left(Clip(L:L)),True)
  EXLClass.Write(R,9, Left(Clip(L:X_1)),True);  EXLClass.Write(R,10,Left(Clip(L:X_2)),True); EXLClass.Write(R,11,Left(Clip(L:X_12)),True)
  EXLClass.Write(R,12,Left(Clip(L:G25)),True);  EXLClass.Write(R,13,Left(Clip(L:GL25)),True); EXLClass.Write(R,14,Left(Clip(L:L25)),True)
  EXLClass.Write(R,15,Left(Clip(L:F1)),True);   EXLClass.Write(R,16,Left(Clip(L:F2)),True)
  EXLClass.Write(R,17,Left(Clip(L:Gol1)),True); EXLClass.Write(R,18,Left(Clip(L:Gol2)),True)
  If Lis:Date = Today() Then
     EXLClass.SelectRange(R,6,R,18); EXLClass.SetFont(,,,Font:Bold)
  .
  Sav:With = 18                                                                        !
ClaFormatM Routine                                                       !
 L:Code = Format(Lis:TNumber,@N_5)                                       !
 L:Date = Format(Lis:Date,@D05)                                          !
 L:Time = Format(Lis:Time,@t01)                                          !
 L:DT   = L:Date & L:Time                                           !
 L:T1   = Format(Lis:Team1,@S30)                                         !
 If Lis:Status='H' Then Lis:Team2 = Clip(Lis:Team2)&Clip(Lis:Fora).      !
 L:T2   = Format(Lis:Team2,@S30)                                         !
 L:TT   = Clip(L:T1) & ' - ' & Clip(L:T2)                                !
 L:W    = Format(LIS:W,@N6.2)  ;  If LIS:W <= 1    then L:W    = '  - '. !
 L:X    = Format(LIS:X,@N6.2)  ;  If LIS:X <= 1    then L:X    = '  - '. !
 L:L    = Format(LIS:L,@N6.2)  ;  If LIS:L <= 1    then L:L    = '  - '. !
 L:X_1  = Format(LIS:X_1,@N6.2);  If LIS:X_1 <= 1  then L:X_1  = '  - '. !
 L:X_2  = Format(LIS:X_2,@N6.2);  If LIS:X_2 <= 1  then L:X_2  = '  - '. !
 L:X_12 = Format(LIS:X_12,@N6.2); If LIS:X_12 <= 1 then L:X_12 = '  - '. !
 L:G25  = Format(LIS:G25,@N6.2);  If LIS:G25 <= 1  then L:G25  = '  - '. !
 L:L25  = Format(LIS:L25,@N6.2);  If LIS:L25 <= 1  then L:L25  = '  - '. !
 L:GL25 = Format(LIS:GL25,@N6.1); If LIS:GL25 = 1  then L:GL25 = '  - '. !
 L:F1   = Format(LIS:Fre1,@N6.2); If LIS:Fre1 <= 1 then L:F1   = '  - '. !
 L:F2   = Format(LIS:Fre2,@N6.2); If LIS:Fre2 <= 1 then L:F2   = '  - '. !
 L:Gol1 = Format(LIS:Gol1,@N6.2); If LIS:Gol1 <= 1 then L:Gol1 = '  - '. !
 L:Gol2 = Format(LIS:Gol2,@N6.2); If LIS:Gol2 <= 1 then L:Gol2 = '  - '. !
  
	 
!*** GetDivNAme ***********
GetDivName Routine        !
  if lis:Status='P' Then
     Spe:Code = LIS:SpecHeadCode
     Get(Spec,Spe:Key_Code)
     If Errorcode() Then Loc:HeadM = 'Secdoma! ar weria speSalis kodi'; Er#=1
                    Else Loc:HeadM = Spe:Name; ER#=0.
  Else
     CHA:Code = LIS:HeadCode
     Get(Champ,CHA:Key_Code)
     Loc:HeadM = CHA:Name
  .
     R = R+1
     If INDX#=0 Then
        INDX#=1
        Sav:S_Row = R
     Else
        Sav:E_Row = R-1
        If Sav:E_Row > Sav:S_Row Then
           EXLClass.SelectRange(Sav:S_Row,1,Sav:E_Row,Sav:With)
           EXLClass.DrawTable(BoxMode:Table,LineStyle:Dash,BorderWeight:Hairline)
        .
        Sav:S_Row = R
     End
  EXLClass.SelectRange(Sav:B_D,1,Sav:B_D,Sav:With);
  EXLClass.SetBorder(Border:EdgeBottom,LineStyle:Continuous,BorderWeight:Thin)
  EXLClass.SelectRange(Sav:B_D+1,1,Sav:B_D+1,Sav:With);
  EXLClass.SetBorder(Border:EdgeBottom,LineStyle:Double,BorderWeight:Thick)
  If Loc:NBA_NHL = 1 Then
     EXLClass.SelectRange(Sav:B_D); EXLClass.RowHeight(30)
  Else
     EXLClass.SelectRange(Sav:B_D); EXLClass.RowHeight(19)
  .