multiple images in SSRS Table Cell

2019-09-05 01:01发布

I am using table in SQL Server Reporting Services. I am getting a data table from a database. The data table has three columns. One column has images names separated by commas.

Data Table:

Type  Status  Images
 1      1      one.jpg,two.jpg,three.jpg
 2      2      four.jpg,two.jpg,seven.jpg
 3      1      one.jpg,six.jpg

I am showing these three rows in an SSRS table. How can I show images as per row cell?

1条回答
太酷不给撩
2楼-- · 2019-09-05 01:34

Dynamically adding images to an SSRS report isn't as easy as dynamically changing or hiding images. So two approaches come to mind.

If order of the images doesn't need to change: Place all of the needed images into a cell. Set the visibility formula for each one to check if the appropriate image is listed in the field.

=IIF(INSTR(Fields!Images.Value, "one.jpg") > 0, false, true)

A different approach if the order needs to match the order in the SQL table:

Write some custom code to break the comma separated string apart, returning element x. Add a bunch of images to the appropriate cell. Then set the Image property of each to call you custom code. For example the Image property of the first might be:

=Code.GetImageName(Fields!Image.Value, 1)

and the second would be

=Code.GetImageName(Fields!Image.Value, 2)
查看更多
登录 后发表回答