Displaying Image from SQL Server in Crystal Reports

馋奶兔 提交于 2019-12-23 05:02:04

问题


I have a couple of images in my SQL Server 2008 table of which the datatype is image.

In my VS.net 2008 project I have a crystal report which is displaying all the fields from that table, but the image is showing as a blank image.

Any thoughts, How I can make it work?


回答1:


You have to convert the image before you can show it.

In crystal reports, you can click on the image control and set the value property of the control to the following (replace ImageFieldName with your field name)

System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value), 105))


来源:https://stackoverflow.com/questions/1764346/displaying-image-from-sql-server-in-crystal-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!