JPG Image in Forte Reports Delphi

Asked

Viewed 88 times

0

Good afternoon, you guys. I have a Production Control Register with product image. It accepts both BMP and JPG. This image is recorded in Firebird 2.5. I made an impression of this Control’s production form in Fortes Reports. When I had Fortes Reports open the preview of an image record. BMP it opens normally, but when the image is JPG it gives Access Violation each time from a different address, including the Privileged Instruction Error. This is the Code I use in the Rlimage Beforeprint Event to upload the image.

    procedure TFFichaProducao.RLImage1BeforePrint(Sender: TObject;
  var PrintIt: Boolean);
var  strreferencia,caminho: string;
begin
  strreferencia := frmControleProducao.edtCodigo.Caption;
  ControleProducao.Close;
  ControleProducao.SQL.Clear;
  ControleProducao.SQL.Add('SELECT * FROM CONTROLE_PRODUCAO WHERE CODIGO =' + #39 + strreferencia + #39);
  ControleProducao.Open;
  caminho := Trim(ControleProducao.FieldByName('FOTO').AsString);
  if ControleProducao.FieldByName('FOTO').AsString <> ''  then
  begin
    if (fileexists(caminho)) then
      RLImage1.Picture.LoadFromFile(caminho)
    else
    if not (fileexists(caminho)) then
      RLImage1.Picture.LoadFromFile('C:\IS40\FOTOS\notfound.bmp')
  end
  else if ControleProducao.FieldByName('FOTO').AsString = ''  then
  begin
    RLImage1.Picture.LoadFromFile('C:\IS40\FOTOS\notfound.bmp')
  end;
end;

inserir a descrição da imagem aqui

Does anyone have any idea what can be done about it? Thank you very much!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.