How using parameter value for PictureObject

version 2025.2

tried using ImageSourceExpression, but not working.

Comments

  • Hello!

    We have tested PictureObject.ImageSourceExpression on the latest versions of FastReport.Core 2026.2.8 and FastReport.OpenSource 2027.1.0: substituting a file path or parameter via ImageSourceExpression = ‘[ImgPath]’ does indeed result in a blank image.

    Please use one of the following two reliable methods:

    Pass the path/URL directly to ImageLocation within the BeforePrint handler:

    private void Picture1_BeforePrint(object sender, EventArgs e)
    {
    Picture1.ImageLocation = Convert.ToString(Report.GetParameterValue(‘ImgPath’));
    }
    

    Alternatively, pass the bytes or the image to `Prepare()` via `PictureObject.SetImageData(File.ReadAllBytes(path))`

This discussion has been closed.