在 Crystal Reports 中显示来自 SQL Server 的图像 [英] Displaying Image from SQL Server in Crystal Reports
本文介绍了在 Crystal Reports 中显示来自 SQL Server 的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 SQL Server 2008 表中有几张图像,其中 datatype
是 image
.
I have a couple of images in my SQL Server 2008 table of which the datatype
is image
.
在我的 VS.net 2008 项目中,我有一个水晶报表,它显示了该表中的所有字段,但图像显示为空白图像.
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?
推荐答案
必须先转换图片才能显示.
You have to convert the image before you can show it.
在水晶报表中,可以点击图片控件,将控件的value属性设置为如下(ImageFieldName替换为你的字段名)
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))
这篇关于在 Crystal Reports 中显示来自 SQL Server 的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文