如何在Crystal Reports中添加图片框?我使用C# - VS 2008 [英] How add picturebox in Crystal Reports? I using C# - VS 2008

查看:85
本文介绍了如何在Crystal Reports中添加图片框?我使用C# - VS 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Crystal Report中添加图片框?我使用C# - VS 2008

解决方案

我们可以轻松地从数据库中的文件位置插入水晶报表中的图片。



1.创建数据集,创建数据表并在Crystal报表中添加所需的列。为您的图片添加一列。例如: - MyImage并将数据类型设为System.Byte()



2.打开水晶报告并将数据集设置为报告源。



3.按下按钮提供以下代码



 Dim lFSFileStream As FileStream 
Dim lBRBinaryReader As BinaryReader
Dim lBImageByte As Byte()

lFSFileStream = New FileStream(FilePathFromDataBase,FileMode.Open)

lBRBinaryReader = New BinaryReader(lFSFileStream)

lBImageByte =新字节(lFSFileStream.Length + 1){}


lBImageByte = lBRBinaryReader.ReadBytes(Convert.ToInt32(lFSFileStream.Length))
lFSFileStream .Close()









并设置lBImageByte变量到数据表列MyImage







4.将MyImage项目拖放到报告中。







或访问链接....



http://social.msdn.microsoft.com/Forums/en -US / 29391a49-296a-47c1-ba70-0c2069a28a8d / printing-picturebox-image-in-crystal-report [ ^ ]


我有QR码生成器,QR码在图片框中,我想添加到水晶报告...



不需要DB ...

How add picturebox in Crystal Report? I using C# - VS 2008

解决方案

we can easily insert picture in crystal report from file location in database.

1. Create a data set, create a data table and add columns you need in crystal report. add a column for your image. eg:- MyImage and give datatype as System.Byte()

2. Open crystal report and set data set as report source.

3. Give the following code in button click

Dim lFSFileStream As FileStream
 Dim lBRBinaryReader As BinaryReader
 Dim lBImageByte As Byte()

 lFSFileStream = New FileStream(FilePathFromDataBase, FileMode.Open)

 lBRBinaryReader = New BinaryReader(lFSFileStream)

 lBImageByte = New Byte(lFSFileStream.Length + 1) {}


 lBImageByte = lBRBinaryReader.ReadBytes(Convert.ToInt32(lFSFileStream.Length))
 lFSFileStream.Close()





and set lBImageByte variable to data table column MyImage



4. drag drop MyImage item into report.



or visit on the link....

http://social.msdn.microsoft.com/Forums/en-US/29391a49-296a-47c1-ba70-0c2069a28a8d/printing-picturebox-image-in-crystal-report[^]


i have QR code generator, QRcode is in picture box, and i want add to crystal report...

No need DB...


这篇关于如何在Crystal Reports中添加图片框?我使用C# - VS 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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