Table of Content
HAL Forum
procedure OutImage (
Integer column,Integer width,Integer height,Record rec)
Description:
Will output the first found image attached to the record that is in the right format for the operating system of the client (if any). This works for reports to screens and printers. No other media types currently supported.
Parameters:
column Report column or print position
width max width of image
height max height of image
rec record with potential images attached
// Available from 6.2-100119.
global
procedure SearchItemRn(record RcVc RepSpec)
begin
  record INVc INr;
  record LetVc Letr;
  boolean TrHs,testf;
  string 255 tstr,keystr;
  integer cnt, rw;  
 
  cnt = 0;
  rw = 1;
  if(nonblank(RepSpec.f2))then begin
    keystr = "DICode:" & RepSpec.f2;
  end else begin
    keystr = "Code";
  end;
  StartReportJob(USetStr(13500));
  if (nonblank(RepSpec.f1)) then begin
    switch (RepSpec.ArtMode) begin
      case 0:tstr = USetStr(13501) & RepSpec.f1;
      case 1:tstr = USetStr(13502) & RepSpec.f1;
      case 2:tstr = USetStr(13503) & RepSpec.f1;
      case 3:tstr = USetStr(13504) & RepSpec.f1;
      case 4:tstr = USetStr(13505) & RepSpec.f1;
      case 5:tstr = USetStr(13506) & RepSpec.f1;
    end;
    Header(rw,tstr,1);
    rw = rw + 1;  
  end;
  EndHeader;
  if (blank(RepSpec.f1)) then begin
    goto LSearchItemRn;
  end;
  SetRepCol(2,90);
  SetRepCol(3,300);  
  StartFormat(15);
  OutString(0,0,USetStr(13507),false);
  OutString(2,0,USetStr(13508),false);
  OutString(3,0,USetStr(13509),false)
  OutString(1,0,USetStr(13510),true);
  EndFormat;
  Gray_Divider(0,1);
  TrHs = true;
  while (LoopKey(keystr,INr,1,TrHs)) begin
    if (TrHs) then begin
      testf = false;
      RecordNew(Letr);
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 1) then begin
        AddToText(INr.Code,Letr);
        AddToText(" ",Letr);
      end;
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 2) then begin
        AddToText(INr.Name,Letr);
        AddToText(" ",Letr);
      end;
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 3) then begin
        AddToText(INr.Group,Letr);
        AddToText(" ",Letr);
      end;
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 4) then begin
        AddToText(INr.AlternativeCode,Letr);
        AddToText(" ",Letr);
      end;
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 4) then begin
        AddToText(INr.UserStr1,Letr);
        AddToText(" ",Letr);
      end;
      if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 5) then begin
        AddToText(INr.UPrice1,Letr);
        AddToText(" ",Letr);
      end;
      if (StringInText(RepSpec.f1,Letr)) then begin
        testf = true;
      end;
      if (INr.Terminated == 1) then begin
        testf = false;
      end;
      if (testf) then begin
        StartFormat(15);
        switch(RepSpec.f3) begin
          case "IVDClass":       OutString(0,"DCPasteIVItem",INr.Code,false);  
          case "PODClass":       OutString(0,"DCPastePOItem",INr.Code,false);
          case "QTDClass":       OutString(0,"DCPasteQTItem",INr.Code,false);
          case "ORDClass":       OutString(0,"DCPasteOrderItem",INr.Code,false);
          case "StockTakeDClass":OutString(0,"DCPasteStockTakeItem",INr.Code,false);
          case "ProdDClass":     OutString(0,"DCPasteProdItem",INr.Code,false);
          case "RecDClass":      OutString(0,"DCPasteRecItem",INr.Code,false);
          case "VIDClass":       OutString(0,"DCPasteVIItem",INr.Code,false);
          case "POQTDClass":     OutString(0,"DCPastePOQTItem",INr.Code,false);
          case "IntORDClass":    OutString(0,"DCPasteIntORItem",INr.Code,false);
          case "SVODClass":      OutString(0,"DCPasteSVOItem",INr.Code,false);
          case "WODClass":       OutString(0,"DCPasteWOItem",INr.Code,false);
          case "WSDClass":       OutString(0,"DCPasteWSItem",INr.Code,false);
          case "PUDClass":       OutString(0,"DCPastePUItem",INr.Code,false);
          case "SDDClass":       OutString(0,"DCPasteSDItem",INr.Code,false);
          case "SRDClass":       OutString(0,"DCPasteSRItem",INr.Code,false);
          case "StockMovDClass": OutString(0,"DCPasteStockMovItem",INr.Code,false);
          case "RetDClass":      OutString(0,"DCPasteRetItem",INr.Code,false);
          otherwise
            OutString(0,"DblINVc",INr.Code,false);
        end;
        OutString(2,0,INr.Name,false);
        OutString(3,0,INr.Group,false);
        OutImage(340,100,30,INr);
        OutString(1,0,INr.UPrice1,true);
        EndFormat;
        cnt = cnt + 1;
      end;
    end;
  end;
  Gray_Divider(0,1);
  StartFormat(15);
  OutString(0,0,USetStr(13511),false);
  OutVal(100,0,cnt,M40Val,true);
  EndFormat;
  
LSearchItemRn:;
  EndJob;
  return;
end;


Related topics:
««