2016-03-23 15 views
0

SQLアダプタを使用してデータテーブルを作成しています。私はそれが正常にdatagridviewに表示することができますが、私は、正しく動作しませんreportviewerをしようとするときに取得することができます。DataTableをReportViewerにロードする

DataTable dt = new DataTable(); 
dt.TableName = "SwipeReport"; 
da.Fill(dt); 

reportViewer1.Reset(); 
reportViewer1.ProcessingMode = ProcessingMode.Local; 
reportViewer1.LocalReport.ReportEmbeddedResource = "POC1.SwipeReport.rdlc"; 
reportViewer1.LocalReport.DataSources.Clear(); 
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SwipeReport", dt)); 
reportViewer1.RefreshReport(); 

私はレポートビューアーウィンドウを埋めることになっていたときにを「レポートが指定されていない」を取るにつれて、私は正しくレポート埋め込みリソースを設定してい信じていません。これを正しく実装しましたか?

答えて

0

が、これは

 // create a new report from the created CrystalReport 
     GeneralSupportRpt myDataReport = new GeneralSupportRpt(); 

     // set the data source of the report 
     myDataReport.SetDataSource(dataTable); 

     // set the report source of the created “crystalReportViewer” 
     // component to the created report 

     ReportViewer.ReportSource = myDataReport; 
を役に立てば幸い
関連する問題