标签:预览 turn cdc sed logs file reporting 分享 sel
图片以二进制存储于数据库表中。在显示RDLC报表时,把图片呈现出来。
好吧。
把存储过程写好:
CREATE PROCEDURE [dbo].[usp_File_Select] AS SELECT [Afd_nbr],[Picture],[PictureType],[FileExtension] FROM [dbo].[ApiFileDemo] GO
public DataTable GetFiles() { sp.ConnectionString = DB.SqlConnectionString(); sp.Parameters = null; sp.ProcedureName = "usp_File_Select"; return sp.ExecuteDataSet().Tables[0]; }
报表设计完成。现在创建一个ASPX网页来呈现这个RDLC报表:
private void Data_Binding() { this.ReportViewer1.Reset(); this.ReportViewer1.LocalReport.Dispose(); this.ReportViewer1.LocalReport.DataSources.Clear(); Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource(); rds.Name = "FileDataSet"; FileEntity fe = new FileEntity(); rds.Value = fe.GetFiles(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Rdlc/ImageRpt.rdlc"); this.ReportViewer1.LocalReport.DataSources.Add(rds); this.ReportViewer1.LocalReport.Refresh(); }
预览一下看看结果如何:
数据没有显示出来,一直不停在Loading...
虽然数据显示出来,但是在第二列中,图片没有显示,却显示#Error。还没有成功,还得继续努力:
标签:预览 turn cdc sed logs file reporting 分享 sel
原文地址:http://www.cnblogs.com/insus/p/7778936.html