2013-05-27 5 views
2
private void SetReportSource() 
{ 
    DataTable dt; 

    dt = FrmSummaryController.GetSummaryReport(); 

    this.rptMySummary.Reset(); 
    this.rptMySummary.LocalReport.ReportPath = "Report.rdlc"; 
    ReportDataSource rds = new ReportDataSource("dsNewDataSet_Table", dt); 

    //this.rptMySummary.LocalReport.DataSources.Clear(); 
    this.rptMySummary.LocalReport.DataSources.Add(rds); 

    this.rptMySummary.LocalReport.Refresh(); 
} 

보고서 뷰어를 채우는 코드입니다. 나는 데이터 테이블 dt에 오는 데이터의 6 라인이 있다고 확신합니다.C# reportviewer가 데이터를 표시하지 않습니다.

보고서 뷰어에는 줄과 제목이 없습니다.

내가 뭘 잘못하고 있는지 조언 해 주실 수 있습니까?

+0

뭔가 다른 부분에 도킹되어있는 경우 새로 고침해야 할 수도 있습니다. – James

답변

0

다음 단계를 따르십시오. 보고서 바인딩이 없습니다.

reportDocument.Load(this.MapPath("crpt_test.rpt"));<br> 
reportDocument.Database.Tables[0].SetDataSource(dsReport.Tables[0]);<br> 
rptviewer.ReportSource = IT_proj_reportDocument;<br> 
rptviewer.Visible = true;<br> 
rptviewer.DataBind();<br> 

모든 파일 형식으로 내보내기.

관련 문제