通过C#窗体在Crystal Report上动态显示图像 [英] Dynamically Displaying image on Crystal Report from C# Form

查看:80
本文介绍了通过C#窗体在Crystal Report上动态显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
尊敬的程序员iam将通过Button单击的C#窗体在Crystal报表上显示图像.图像路径应从当前项目中选择.
我已将其与数据库一起显示,但无法从当前项目路径中的图像显示它.
请任何人帮助我.

HY Everybody,
Dear programmers iam going to display an image on crystal report from C# Form on Button Click.The image path should be Selected from the Current Project.
i have display it with database but i cannot display it from the images present in my current project path.
Please any body help me.

推荐答案


如果要将数据表或数据集用作水晶报表的数据源,那么它非常容易.
只需将图像读入流中即可.将流添加为数据表中的列.将表设置为数据源.就是这样.

Hi,
If you are using datatable or dataset as datasource for crystal reports, then its very easy.
Just read the images into a stream. add the stream as a column in your data table. set the table as datasource. thats it.

//Just for an information I'm just typing this code
//Correct the syntactical errors
DataTable tbl;
MemoryStream ms;

//your data table filling logic
tbl.Columns.add("ImageColumn",typeof(string));//Fine tune this
ms = //load your image into stream
tbl.rows(0).setitem //to set the image data
//set this tbl as datasource for your report


要显示图像,请查看以下内容:
如何使用Visual Studio 2005在Crystal Reports中动态加载图像 [ Crystal Reports:如何在Crystal Report中显示图像 [ Crystal Reports中的图像 [
To display images, have a look at these:
How to dynamically load images in Crystal Reports using Visual Studio 2005[^]
Crystal Reports: How to Display Images in a Crystal Report[^]
Image in Crystal Reports[^]


这篇关于通过C#窗体在Crystal Report上动态显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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