如何在访问数据库2007中显示图像,尽管所有数据都显示在rdlc中 [英] How to display image from access database 2007 although all data display in rdlc
问题描述
显示图像从访问2007数据库到rdlc有问题
i工作在windows窗体中c#vs2015
其实我需要从数据库显示图像到访问2007年的更多记录
但我不能
$ b $ r in rdlc我做如下:
在RDLC
将图像控制拖动到
报告源数据库
mime type jpeg
set EnableExternalImages = true
= First(Fields !qrimg.Value,DataSetImage)for value
名称作为数据集中列的名称。
在数据集中
qrimg system.Byte []
on interface <按钮点击查看报告中的
reportViewer1.LocalReport.EnableExternalImages = 真跨度>;
QrClasses q = new QrClasses();
DataSetImage printexcel = q.GetDataImage();
ReportDataSource datasource = new ReportDataSource( DataSetImage ,printexcel.Tables [ 0 ]);
this .reportViewer1.LocalReport.DataSources.Clear();
this .reportViewer1.LocalReport.DataSources.Add(datasource);
this .reportViewer1.RefreshReport();
< span class =code-keyword> public DataSetImage GetDataImage()
{
using (OleDbConnection con = new OleDbConnection(连接))
{
使用(OleDbCommand cmd = new OleDbCommand( SELECT UserID,UserNameAR,CountryAR,MemberAR,qrimg FROM AllPrinting))
{
使用(OleDbDataAdapter sda = new OleDbDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
使用(DataSetImage dsimage = new DataSetImage())
{
sda.Fill(dsimage, DataTable1);
return dsimage;
}
}
}
}
}
最终结果我可以显示所有数据来自2007年的报告,但图片无法显示
可以随时帮助我
i do所有的事情,但真的无法显示图像。
我尝试过:
如何在访问数据库2007中显示图像,尽管所有数据都显示在rdlc
请查看如何:添加数据绑定图像(Reporting Services) [ ^ ]。
请特别注意从Access图像中删除OLE标题部分:
= System.Convert。 FromBase64String(MID(System.Co nvert.ToBase64String(字段!ImageFieldName.Value),105))
I have problem in display image from access 2007 database to rdlc
i work in windows form c# vs2015
Actually i need to display image from database to more records from access 2007
but i cannot
in rdlc i do as following :
In RDLC
drag image control to
report source database
mime type jpeg
set EnableExternalImages = true
=First(Fields!qrimg.Value, "DataSetImage") for value
Name as Name of column in dataset .
In dataset
qrimg system.Byte[]
on interface
in button click view report
reportViewer1.LocalReport.EnableExternalImages = true;
QrClasses q = new QrClasses();
DataSetImage printexcel = q.GetDataImage();
ReportDataSource datasource = new ReportDataSource("DataSetImage", printexcel.Tables[0]);
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(datasource);
this.reportViewer1.RefreshReport();
public DataSetImage GetDataImage()
{
using (OleDbConnection con = new OleDbConnection(connection))
{
using (OleDbCommand cmd = new OleDbCommand("SELECT UserID,UserNameAR,CountryAR,MemberAR,qrimg FROM AllPrinting"))
{
using (OleDbDataAdapter sda = new OleDbDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSetImage dsimage = new DataSetImage())
{
sda.Fill(dsimage, "DataTable1");
return dsimage;
}
}
}
}
}
Final result i can show all data from access 2007 in report but image cannot display
can any one help me please if possible
i do every thing but really cannot show image .
What I have tried:
How to display image from access database 2007 although all data display in rdlc
Have a look at How to: Add a Data-Bound Image (Reporting Services)[^].
Pay particular attention to the section To remove the OLE header from an Access image:
=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value),105))
这篇关于如何在访问数据库2007中显示图像,尽管所有数据都显示在rdlc中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!