을 한 번에 자신의 이름 중 하나를 선택합니다 후 결박보고 있습니까? 그게 당신이 찾고있는 경우 다음 코드는 당신을 도울 수 있습니다 :
private DataTable GetData(string tableName)
{
DataSet ds = new DataSet();
string query = "Select * from something";
OdbcDataAdapter da = new OdbcDataAdapter(query, conn);
da.Fill(ds);
DataTable dt = ds.Tables[tableName];
return dt;
}
//You can fill the dataset once and then just get the table by table name. No necessary that you have to fill the dataset every time to get tables
private void RunReportViewer()
{
this.ReportViewer1.Reset();
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report.rdlc");
ReportDataSource rds = new ReportDataSource("#_your_table_Name", GetData());
this.ReportViewer1.LocalReport.DataSources.Clear();
this.ReportViewer1.LocalReport.DataSources.Add(rds);
this.ReportViewer1.DataBind();
this.ReportViewer1.LocalReport.Refresh();
}