Retrieve image from PostgreSQL BLOB

1 Answer 352 Views
General Discussions
Raniel
Top achievements
Rank 1
Iron
Iron
Raniel asked on 05 Oct 2022, 06:50 AM
Hi, In my current reports, I need to retrieve the client's logo which was stored from our PostgreSQL database as BLOB and this logo will change automatically depends on user. Any reference on how to do this?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 10 Oct 2022, 07:30 AM

Hello Raniel,

When the image value comes from a database, you may use a List in which DataSource references the corresponding database field. You may put a single PictureBox item in the List to display the image. You need to use an Expression like "=Fields.ImageFieldName" for the Value of the PictureBox.

If the image is kept as SVG or Base64 string, you may use ReportParameter to set the Value of a PictureBox that is not in a List. This way you may avoid the additional data item/List. This may not be possible if the image is byte[] though, as the parameters support only Boolean, DateTime, Integer, Float, and String types. 

Regards,
Todor
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Raniel
Top achievements
Rank 1
Iron
Iron
commented on 10 Oct 2022, 08:49 AM

The image that comes from database was stored as byte[], Just for clarification, is it still applicable to use List?
Todor
Telerik team
commented on 12 Oct 2022, 02:18 PM

Hi Raniel,

Yes, you may set a database field containing the image as byte[] directly to the PictureBox Value in a List.

Tags
General Discussions
Asked by
Raniel
Top achievements
Rank 1
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or