如何在Visual Studio中从数据库中设置Crystal Report Viewer的Picture Control中的动态画面? [英] How can i set dynamic picture in Picture Control of Crystal Report Viewer from database in Visual Studio?

查看:71
本文介绍了如何在Visual Studio中从数据库中设置Crystal Report Viewer的Picture Control中的动态画面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经在vb.net上设计了水晶报告,我想在我的项目上显示该报告的图片。我在CR上删除了Picture Control,我试图找到这个控件的属性来设置数据库的图片路径,但我没有看到它。有没有人知道这个?

注意:

- 我使用Visual Studio 2008

- CR版本2008



谢谢



TONY

Hi all experts,
I have designed crystal report on vb.net already and i want to display the picture on my item to that report. i dropped Picture Control on CR and i try to find the property of this control to set the picture path from database but i don''t see it. Does anybody know about this?
Note:
- I use Visual Studio 2008
- CR Version 2008

Thanks

TONY

推荐答案





您需要将图像列(byte [])添加到表中,添加要报告的列,(不是Picture控件,但是字段):



Hi,

you need to add image column (byte[]) to the table, add the column to report, (not Picture control, but field) :

data.Tables(0).Columns.Add("img", System.Type.GetType("System.Byte[]"))

' fill the table with pictures from database or file system
'...
'...

' create a report
Dim cr As New CrystalReport1()

' pass a dataset  to a report 
cr.SetDataSource(data.Tables(0))

' pass a reportdocument to the viewer
CrystalReportViewer1.ReportSource = cr





其中数据是您的数据集。



Where "data" is your dataset.


这篇关于如何在Visual Studio中从数据库中设置Crystal Report Viewer的Picture Control中的动态画面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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