Отчет в графике на Visual RSL: "Платежки полученные Бэк Офисом"

Автор:Юрий Травкин
Дата:11.11.2002
Просмотров:2468
Скачиваний:757
Оценка:, Оценок - 1
Скачать (rar-файл; Размер - 130939)

Обсудить в форуме

Описание

Создание графического отчет на Visual RSL: "Количество платежных
документов полученных банком по клиентам".

Текст примера

 /* =======================================================================
                                                           
   Назначение: 
   ----------
      Создание графического отчет на Visual RSL: "Количество платежных
   документов полученных банком по клиентам".

   Описание: 
   --------

   Внимание!  Путь к папке ..\Dbfile БОУРМа нужно прописать в 25 строке 
   этого файла, в переменной DBFile. 

   Поместите файлы Differ.rsg и SReport.mac в ..\MAC.

   В меню БОУРМа "Разное"-"Макрофайлы" добавте новую команду для файла 
   SReport.mac. 
     
   =======================================================================*/

  import RSLX; /* для расширений ActiveX */

  Array Client, i_RUR, i_CUR;
  Var vrsl, frm, rpt, i=0, nn=0, itm=0, iMax=100, target="";
  Var key1, tot_RUR=0, tot_CUR=0;
  Var pDoc, cust, DBFile="I:\\ClbB500\\DBFILE\\";


   pDoc = TBfile("clbpdoc","R",0, DBFile + "clbpdoc.dbt" , DBFile + "clntbnk.def"); 
   cust = TBfile("clbclnt","R",0, DBFile + "clbclnt.dbt" , DBFile + "clntbnk.def"); 



     Client[0]="";
     i_RUR[0]=0;
     i_CUR[0]=0;


     Macro ASCAN
        Var i=0, item=0;
        item = Asize(Client); 

        while (i<item)
           if(Client(i) == target) return i end;
           i = i + 1;
        end;

        Client(i) = target;
        i_RUR(i) = 0;
        i_CUR(i) = 0;
        return i;

     end;



/*============================================*/
/*  Точка входа  */

    iMax = NRecords( pDoc );

    vrsl = ActiveX("RSGENOLE.VRslRun.1"); 
    frm = vrsl.RunFrm("Req_Stat2");

    frm.pSRec = 1; 
    if (iMax - 1000>0)
       frm.pSRec = iMax - 1000;
    end;    
    frm.pFileRecord = String(iMax);
    frm.pReturnCod = 0;
    frm.openForm ();

    IF (frm.pReturnCod != 0)


    iMax = NRecords( pDoc );
/*    MSGBOX( iMax );*/

    rewind(pDoc);
    next(pDoc);
    key1 = pDoc.Rec.ID+frm.pSRec; 


    pDoc.Rec.ID = key1; 
    if( GETGE( pDoc ) )
/*        MSGBOX( pDoc.pDocDate );*/
    end;


    initProgress ( iMax );

    SetOutput("tmp.txt");
    [ Прочитанные записи ];
    [------------------------------------------------------------------];
    iMax = 0;
    while (next(pDoc))

     if ( ( pDoc.Rec.lastProcessDate >= frm.pDateBeg) and ( pDoc.Rec.lastProcessDate <= frm.pDateEnd ) ) 

       target = pDoc.Rec.INN;
       itm = ASCAN;
       if(pDoc.Rec.Form==1001)
          i_RUR(itm) = i_RUR(itm) + 1;
         elif(pDoc.Rec.Form==1002)
          i_CUR(itm) = i_CUR(itm) + 1;
       end;

       [ #          - #                           #            # ](pDoc.Rec.pDocDate, pDoc.Rec.INN, pDoc.Rec.pDocNum, pDoc.Rec.mailTime);
       [------------------------------------------------------------------];
     end;

     iMax = iMax + 1;
     UseProgress (iMax);

    end; /* конец while */
    RemProgress (iMax);  
    

    itm = Asize(Client); 
    nn = 0;
    [   ];
    [  Статотчет по клиентам ];
    [ ------------------------------------------------------------------------];
    [  nn  ИНН/КПП                Название                     ПП          ВП ];
    [ ------------------------------------------------------------------------];
    while (nn<itm)
        cust.Rec.INN = Client(nn);
        GETEQ( cust );
        [ ####  ####################  #                     #########   #########]( nn, Client(nn), cust.Rec.nameShort, i_RUR(nn):z, i_CUR(nn):z ); 
        tot_RUR = tot_RUR + i_RUR(nn);
        tot_CUR = tot_CUR + i_CUR(nn);
        nn = nn + 1;
    end;
    [ ========================================================================];
    [                                                   #########   #########](tot_RUR, tot_CUR);
    [ ];

    SetOutput( Null, True );
/*    ViewFile(report); */


    rpt = VRSL.RunRpt("StatReport");
    rpt.StaticDatBeg.Text = String( frm.pDateBeg ); 
    rpt.StaticDatEnd.Text = String( frm.pDateEnd ); 
    rpt.pDBFile = "I:\\ClbB500\\DBFILE\\"; 

    nn = 1;
    while (nn<itm)
        rpt.pMap.Insert( Client(nn), i_RUR(nn) );
        rpt.pMap2.Insert( Client(nn), i_CUR(nn) );
        nn = nn + 1;
    end;

    rpt.runReport();


    END;