Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Insert image

edited July 2001 in General
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.

Comments

  • edited July 2001

    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
This discussion has been closed.