在Crystal Reports中显示SQL Server中的图像 [英] Displaying Image from SQL Server in Crystal Reports

查看:253
本文介绍了在Crystal Reports中显示SQL Server中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的SQL Server 2008表中有几个图像,其中数据类型是 image p>

在我的VS.net 2008项目中,我有一个水晶报告显示该表中的所有字段,但图像显示为空白图像。

$

解决方案

任何想法,我如何使它工作?



在水晶报表中,您可以点击图片控件,并将控件的value属性设置为以下内容(将ImageFieldName替换为您的字段name)

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


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?

解决方案

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))

这篇关于在Crystal Reports中显示SQL Server中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆