unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids, DBGrids, Db, DBTables, ekfunc, EkRtf, StdCtrls, Mask, ekbasereport;

type
  TForm1 = class(TForm)
    Table1: TTable;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    EkRTF1: TEkRTF;
    Button1: TButton;
    Button2: TButton;
    StaticText1: TStaticText;
    NEdit: TMaskEdit;
    StaticText2: TStaticText;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  n, SkipLabels:integer;
  SkipLinesNumber:double;
  
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
 Table1.First;
 n:=StrToInt(Trim(NEdit.Text));
 SkipLinesNumber:=int(n/3);
 SkipLabels:=n mod 3;
 with EKRTF1 do begin
  ClearVars;
  CreateVar('SkipLinesNumber',SkipLinesNumber);
  CreateVar('SkipLabels',SkipLabels);
  EKRTF1.ExecuteOpen([table1],SW_SHOW);
 end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Close;
end;

end.
