In this video " How to create Report that gets Images from Database Table" we are going to learn below items
Sample script for the SSRS Report
How to Get Image from Database Table and Display in SSRS Report - SSRS Tutorial
- How to Create Sample Table and Store Images to it in SQL Server
- How to create New Empty Report and Create Data Set Including Image Field from Table
- How to use Image Item in SSRS Report and Map to Image Field from Table
- Learn Image Item Properties to fit Image properly in SSRS Report
Sample script for the SSRS Report
--drop table [dbo].[TotalSale]
CREATETABLE [dbo].[TotalSale] (
[id] [int] NOTNULL
,[SalePersonFName] [varchar](100) NULL
,[SalePersonLName] [varchar](100) NULL
,[ProductName] [varchar](100) NULL
,[ItemsSold] [int] NULL
,[SoldPrice] [float] NULL
,[SoldDate] [date] NULL
,[City] [varchar](100) NULL
,[State] [varchar](100) NULL
,[Country] [varchar](100) NULL
,[Region] [varchar](100) NULL
,SalePersonImage VARBINARY (MAX) NOTNULL
)
INSERT [dbo].[TotalSale] (
[id]
,[SalePersonFName]
,[SalePersonLName]
,[ProductName]
,[ItemsSold]
,[SoldPrice]
,[SoldDate]
,[City]
,[State]
,[Country]
,[Region]
,SalePersonImage
)
Select
1
,N'Aamir'
,N'Shahzad'
,N'TV'
,1
,700
,CAST(N'2015-07-15'ASDATE)
,N'Charlotte'
,N'NC'
,N'USA'
,N'North America'
,BulkColumn
FROMOPENROWSET (BULK'C:\Users\ashahzad\Desktop\InputFolder\Aamir.png', SINGLE_BLOB)
AS SalePersonImage
UnionAll
Select
2
,N'M'
,N'Raza'
,N'Cell Phone'
,2
,800
,CAST(N'2015-07-15'ASDATE)
,N'Charlotte'
,N'NC'
,N'USA'
,N'North America'
,BulkColumn
FROMOPENROWSET (BULK'C:\Users\ashahzad\Desktop\InputFolder\Aamir.png', SINGLE_BLOB)
AS SalePersonImage
How to Get Image from Database Table and Display in SSRS Report - SSRS Tutorial