I use a report file and a ReportViewer control to display a report that dynamically loads data from objects at runtime.
I need to show an image that is stored in a byte array in an object.
PictureBox is currently set to:
=First(Fields!ImageData.Value, "dtstItemImage")
And I installed DataSource using:
ImageBindingSource.DataSource = this.item.Image.ImageData;
The code compiles and runs, but the image does not appear in the report .
Is it because the PictureBox needs to be bound to the Image object (and not to the byte array)? Or maybe there are some PictureBox properties that I need to set?
UPDATE 1
I added a border to the PictureBox to make sure its visibility and that it is displayed in the report. It just does not contain an image.
UPDATE 2
I fixed a bug in my code. I changed:
ImageBindingSource.DataSource = this.item.Image.ImageData;
in
ImageBindingSource.DataSource = this.item.Image;
since the PictureBox is bound to the ImageData field, but the DataSource is an Image object.
Now I get a small cross icon instead of nothing, which (at least for me) indicates some progress, but I donβt know where the byte [] conversion code of the bitmap should be.
source share