Table of Content
HAL Forum
procedure EndFormLabel (
)
Description:
Ends one label on specified form. The total amount of labels on one page is determined by FormLabelGrid
procedure DoPrintOwnCheck(record RcVc RepSpec,string formcode,string langcode,string printer)
begin
  Boolean formisopenf;
  LongInt lbls,lblYstep;
  LongInt fromchq,tochq;
  record OwnCheckVc OwnCheckr;
  Boolean found;
  LongInt ownchklabcnt;
  Integer i,rwcnt;
  record DocVc Docr;
  row DocVc Docrw;
  
  ownchklabcnt = 0;
  fromchq = FirstInRange(RepSpec.f1,20);
  tochq = LastInRange(RepSpec.f1,20);
  if (OpenForm(formcode)==false) then begin 
    goto LDoPrintOwnCheck; 
  end;
  SetPrinter(printer);  
  formisopenf = true;
  switch (RepSpec.ArtMode) begin
    case 0: lblYstep = 63150/297; //PageHeight = 842; /* 297 mm */  75*842/297
    case 1: lblYstep = 1;
  end;

  switch (RepSpec.ArtMode) begin
    case 0: FormLabelGrid(1,1,4,lblYstep); lbls = 4;
    case 1: FormLabelGrid(1,1,1,lblYstep); lbls = 1;
  end;
  Docr.Code = formcode;
  if (ReadFirstMain(Docr,1,true)) then begin end;

  found = true;
  OwnCheckr.SerNr = fromchq;
  while (LoopKey("SerNr",OwnCheckr,1,found)) begin  
    if (nonblank(RepSpec.f1)) then begin
      if (OwnCheckr.SerNr>tochq) then begin
        found = false;
      end;
    end;
    if (found) then begin
      if (formisopenf==false) then begin
        if (OpenForm(formcode)==false) then begin 
          goto LDoPrintOwnCheck; 
        end;
        SetPrinter(printer);  
        formisopenf = true;
        switch (RepSpec.ArtMode) begin
          case 0: FormLabelGrid(1,1,4,lblYstep); lbls = 4;
          case 1: FormLabelGrid(1,1,1,lblYstep); lbls = 1;
        end;
      end;
      PrintOwnCheck(RepSpec,OwnCheckr,formcode,langcode);

      rwcnt = MatRowCnt(Docr);
      for (i=0;i<rwcnt;i=i+1) begin
        MatRowGet(Docr,i,Docrw);
        if (Docrw.fieldSetNr==0) then begin
          OUTFORMFIELD(Docrw.unitText,Docrw.unitText);
        end;
      end;  

      EndFormLabel;
      ownchklabcnt = ownchklabcnt + 1;
      if (ownchklabcnt>=lbls) then begin
        CloseForm;
        ownchklabcnt = 0;
        formisopenf = false;
      end;      
    end;
  end;
LDoPrintOwnCheck:;  
  if (formisopenf) then begin
    CloseForm;
  end;
  return;
end;

Related topics:
««