【解決方法】レポート定義のソースが指定されていません


SetParametr を試みる次のコードを使用しています。

C#
var report = new ReportParameter[1];
   report[0] = new ReportParameter("MyName", "Raha");
   var reportDataSource1 = new ReportDataSource { Name = "WpfApplication17_User", Value = _users };
   _reportViewer.LocalReport.DataSources.Add(reportDataSource1);
   _reportViewer.ServerReport.SetParameters(report);
   _reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
   _reportViewer.RefreshReport();

エラー : レポート定義のソースが指定されていません

なぜ間違っているのですか?

レポート パラメータを作成しました。パラメータ名は「MyName」です

私は次のコードを使用しています:

C#
//var report = new ReportParameter[1];
   //report[0] = new ReportParameter("MyName", "Raha");
   var reportDataSource1 = new ReportDataSource { Name = "WpfApplication17_User", Value = _users };
   string exeFolder = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
   _reportViewer.LocalReport.ReportPath =exeFolder + @"\Reports\Report1.rdlc";
   _reportViewer.LocalReport.DataSources.Add(reportDataSource1);
   //_reportViewer.ServerReport.SetParameters(report);
   _reportViewer.RefreshReport();

レポートに表示されるデータ。

しかし、私は次のコードを使用しています:

C#
var report = new ReportParameter[1];
           report[0] = new ReportParameter("MyName", "Raha");
           var reportDataSource1 = new ReportDataSource { Name = "WpfApplication17_User", Value = _users };
           string exeFolder = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
           _reportViewer.LocalReport.ReportPath = exeFolder + @"\Reports\Report1.rdlc";
           _reportViewer.LocalReport.DataSources.Add(reportDataSource1);
           _reportViewer.ServerReport.SetParameters(report);//error
           _reportViewer.RefreshReport();

error as : レポート定義のソースが指定されていません

解決策 1

解決策 4

Hi. I had the same error and the problem was with NULL values from SQL.
Check if you have null values in your SQL result. I  lost two days searching for what is not ok with "The report definition for report '' has not been specified".

解決策 2

親愛なる

私はVb.net 2012を使用しています

Web フォームの私のプロジェクトでは、以下のエラーのレポート ビューの問題があります。

ローカル レポートの処理中にエラーが発生しました。
レポート ‘Report1’ のレポート定義が指定されていません
オブジェクト参照がオブジェクト インスタンスに設定されていません。

助けてください

解決策 3

オンライン

C#
_reportViewer.ServerReport.SetParameters(report);//error 

使用 LocalReport それ以外の ServerReport

コメント

タイトルとURLをコピーしました