简体   繁体   中英

Insert Image into SSRS Report using Pathname from Dataset

I am looking to insert an external image, saved within a local drive, into an SSRS report.

At the moment I have this as the Value expression of the Image:

="file:" + First(Fields!IMGs.Value, "DataSet1")

The value of the field is the location of the image I want to display held within a local drive and typically looks like:

"C:\TEST\IMGs\THIS-01.jpg"

Essentially the combined string should read as :

"file:C:\TEST\IMGs\THIS-01.jpg"

I have also tried replacing the single slashes with double slashes to no avail. So essentially, is this possible and if so where am I going wrong? (as the image is not displaying.)

In Report Data (ctr+Alt+D), 在此处输入图片说明 you can see Images tab.Add the image there and drag it to the report where ever you needed.

My solution is:

In the Image, 'Select the image source' as 'External' and in 'Use this Image' add the expression as ="file:\\"+Parameters!Photo.Value(this is a parameter added by me).

Add a Parameter 'Photo'

Parameter Properties

General-> DataType-> Text

Available Values -> select 'Get values from a query' DataSet ->you dataset name value field-> select the path field from your query Name-> any name

While displaying the report in the preview panel, they will ask to select the Photo parameter value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM