Variable Image where not Printed - Why?

Hello,
i have three images and want to print one of this images in my report. In my record which i read from a database is the information which image i need. Know i want to realise it so
procedure Picture1OnBeforePrint(Sender: TfrxComponent);
begin
  case <DBDatenKunde."Objekt"> of
    'cb' : Picture1.Picture.LoadFromFile('g:\Projekte\Erfassen\Images\Briefe\cb_logo_brief.jpg');
    'cbs' : Picture1.Picture.LoadFromFile('g:\Projekte\Erfassen\Images\Briefe\cbs_logo_brief.jpg');
    'avfb' : Picture1.Picture.LoadFromFile('g:\Projekte\Erfassen\Images\Briefe\avfb_logo_brief.jpg');        
    else Picture1.Picture.LoadFromFile('g:\Projekte\Erfassen\Images\Briefe\cb_logo_brief.jpg');                            
  end;
end;
The Report was printet, but i have no image. When i do it so
procedure Picture1OnBeforePrint(Sender: TfrxComponent);
begin
  case <DBDatenKunde."Objekt"> of
    'cb' : Picture1.Picture.LoadFromFile('cb_logo_brief.jpg');
    'cbs' : Picture1.Picture.LoadFromFile('cbs_logo_brief.jpg');
    'avfb' : Picture1.Picture.LoadFromFile('avfb_logo_brief.jpg');        
    else Picture1.Picture.LoadFromFile('cb_logo_brief.jpg');                            
  end;
end;
i get the error, that the imagefile cannot be open. But the image where in the right directory.

Where is my Problem? How can help me?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:37AM
    try one with out using the case statement, if a picture loads you know the problem is in the case statement
    IIRC case statements evaluate with numerics not strings.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.