0
어디서나 검색했기 때문에 논리를 이해할 수 없기 때문에 질문해야합니다. 보고서 뷰어를 C# 형식으로 만들려고하는데이 보고서를 데이터 테이블의 데이터로 채우고 싶습니다.데이터 보고서에서 보고서 채우기
: 이미 쿼리에서 여기까지SqlCommand cmd1 = new SqlCommand("query_string", Welcome.con);
SqlDataAdapter da = new SqlDataAdapter(cmd1);
DataTable dt = new DataTable();
dt.TableName = "DataTable1";
da.Fill(dt);
내가 데이터 테이블과 아무런 문제가 하지만 난 모든 사람들이 저를주는 사용 발견이 코드를 사용하려고하면 "네임 스페이스를 찾을 수 없습니다"를 작성 채워진
ReportDataSource source = new ReportDataSource("DataTable1", dt);
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(source);
reportViewer1.DataBind();
reportViewer1.LocalReport.Refresh();
내가 도서관이나 무언가를 포함해야하는지 안다? 이 코드가 쿼리 결과로 보고서를 채우기에 충분한 지 궁금합니다. 수동에 대한 참조를 추가해야 할 수도 있으므로,
using Microsoft.Reporting.WebForms
ReportDataSource
이 Microsoft.ReportViewer.WebForms
어셈블리에 정의되어있다 : 그래서 당신은 당신의 .cs 소스 파일의 상단에 using
블록을 추가해야
감사합니다. 그래도 여전히 오류가 발생합니다. reportviewer1.databind(); databind를 위해 그것은 아무런 정의도하지 않는다. –