Display images stored in Database – SSRS


SSRS has a feature to read image data from the SQL Server database. In this article, I will be giving step by step method to store image into database and display it in SSRS reports.

Step 1: Create a table with the following DDL

CREATE TABLE [dbo].[Pictures](
[Picture] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

Step 2: Download this Image to your local drive.

Step 3: Upload image data to SQL table

INSERT INTO dbo.Pictures(Picture)
SELECT * FROM OPENROWSET(BULK N’<>\sql2012.jpg’, SINGLE_BLOB) AS i;
GO

Step 4: Create a report and create data source that connects to the image database and create dataset to fetch the image data from the Pictures table.

Step 5: Add image component and configure with image dataset

Step 6: Click OK and preview the report

Thanks for reading.

About these ads

About Ayyappan Thangaraj

Technology is my passion.
This entry was posted in SSRS and tagged , , , . Bookmark the permalink.

3 Responses to Display images stored in Database – SSRS

  1. Vishal Pawar says:

    Simple and Great post !!

  2. rajendar says:

    Hi Vishal,
    I want more clear details on this topic.

    Raaj

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s