我的朋友即时通讯使用Visual Studio 2008,并且我在c#中开发了一个小型项目,现在我想在其中添加报告(.rdc reports)。这里是我的代码c#中的.rdlc报告不显示任何输出数据?
try
{
reportViewer1.Reset();
con.Open();
command.Connection = con;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "select_book_specific";
param = new SqlParameter("@isbn", "isbn1");
param.Direction = ParameterDirection.Input;
param.DbType = DbType.String;
command.Parameters.Add(param);
adapter = new SqlDataAdapter(command);
adapter.Fill(ds);
// for (int i = 0; i <= ds.Tables[0].Columns.Count - 1; i++)
// {
// MessageBox.Show(ds.Tables[0].Rows[0][i].ToString());
//} For testing purpose
this.reportViewer1.LocalReport.ReportPath = @"C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Report1.rdlc";
this.reportViewer1.LocalReport.DataSources.Add(newReportDataSource("Books",ds.Tables[0].TableName.ToString()));
this.reportViewer1.RefreshReport();
}
catch(exception ex){messageBox.show(ex.message);}
什么是你的问题? – 2013-04-09 03:04:20
什么是'newReportDataSource'你能显示代码吗? – Damith 2013-04-09 03:11:28
@ lc-对不起pal itz一个错误我的问题是报告不显示任何数据? – Roshan 2013-04-09 03:14:01