I have a small web site where I maintain user data, and I maintain the user data in a table that stores their image using a relative URL on the website, like "/images/users/user_id.jpeg".
I am using the ReportViewer control in the asp.net page to show reports from SSRS in the web application.
Now our users want reports to show their image in reports that they can export as pdf and print.
In the SSRS report I tried using an HTML image tag with both full and relative URLs with the option to render HTML, however it's not working.
I tried using the image control in the toolbox with an external URL and that also appears to be not working.
Can someone please help me get around this problem or guide me to some helpful links.
Thanks all.
3条答案
按热度按时间kzmpq1sx1#
I tried everything!!! It wasn't working in BIDS, Web Browser nor a Winform Report Viewer control.
I ended up hard-coding the image and it still didn't work:
I am pretty sure the problem was something to do with Active Directory Group Policy propagation. I suggest to leave it overnight if you have the same problem and have tried everything you can think of:
Anyway next morning I tried and the hardcoded path works and now this dynamic URL works too:
http://MyServer/Reports_SQL2008/Pages/Resource.aspx?ItemPath=%2fProjectReporting%2f " & First(Fields!Brand.Value, "ClientAndBrandByAccount") & "_Logo.png&RetrieveResource=True"
The XML in the RDL file is HTML encoded and looks like this:
I tried to make the Server URL dynamic as Alex Z shows, though I had to use this
Replace
code:yr9zkbsy2#
It will be a lot easier to set up the report so that your users can see the image, if you can see the image in preview in Report Designer.
<Expression...>
option from the dropdown menu for the Value attribute. Edit the expression so that it says="
your URL, without the filename" & Fields!
your image filename data field name.Value
At this point, your users should now be able to see the report images.
toiithl63#
Create a relative url using the expression and global variable
Globals!ReportServerUrl
=
Globals!ReportServerUrl
+ "your path to image"