Hi, I need to insert an image, but this image is not saved in the database, only the paht, is it posible to load the image evey time the report is printed. Thanks in advance.
Place a TppImage control in your report where you wish the image to appear. Assuming that your image is named MyImage, your data pipeline is MyPipeline and that MyImage is in the detail band, place the following code in your detail band's BeforePrint event:
procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject); var lsImagePath: String; begin lsImagePath := MyPipeline.GetFieldAsString('ImagePathFieldName'); if ExtractFileName(lsImagePath) <> '' then try MyImage.Picture.LoadFromFile(lsImagePath); except On EInvalidGraphic do DoSomeExceptionHandling; end; end;
Best regards,
Nard Moseley Digital Metaphors www.digital-metaphors.com
Comments
Place a TppImage control in your report where
you wish the image to appear.
Assuming that your image is named MyImage,
your data pipeline is MyPipeline and that
MyImage is in the detail band, place the
following code in your detail band's
BeforePrint event:
procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
var
lsImagePath: String;
begin
lsImagePath := MyPipeline.GetFieldAsString('ImagePathFieldName');
if ExtractFileName(lsImagePath) <> '' then
try
MyImage.Picture.LoadFromFile(lsImagePath);
except
On EInvalidGraphic do
DoSomeExceptionHandling;
end;
end;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com