2017-10-08 10 views
0

私はSSRSレポートを持っています。オプション(再コンパイル)でSPを使用しているSSRSは、asp.netに埋め込まれたレポートをロードするために永遠に服用していますReportViewer

SSRSブラウザーページhttp://localhost/reportserverを使用してレポートを開くと、レポートは正常に動作し、データが読み込まれます。データはわずか4行です。

しかし、レポートビューアにレポートを埋め込むと、表示される進行状況だけがロードされることはありません。

私はoption(recompile)を追加しましたが、まだ結果はありません。続き

には、以下の私のSP

BEGIN 
-- SET NOCOUNT ON added to prevent extra result sets from 
-- interfering with SELECT statements. 
SET NOCOUNT ON; 

select s.Name,s.Id as STUDENT_ID,a.AttendanceStatus,a.AttendanceDate, 

    case when (select count(*) from 
    Attendance where AttendanceStatus='Present')> 
          (select count(*) from Attendance where 
    AttendanceStatus='Absent') then 'Regular' else 'Not Regular' end as IsRegular 
    from Student s 
    inner join Attendance a on s.Id=a.Student_ID 
    where [email protected]_Id 

    option(recompile) 

END

が、私はその背後にある任意のロジックを知らない私は、レポートビューアー

ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("http://localhost/ReportServer"); 
     ReportViewer1.ServerReport.ReportPath = "/Report1"; 
     ReportViewer1.ProcessingMode = ProcessingMode.Remote; 


     Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[1]; 
     Param[0] = new Microsoft.Reporting.WebForms.ReportParameter("Student_Id","1"); 



     ReportViewer1.ShowParameterPrompts = false; 
     ReportViewer1.ServerReport.SetParameters(Param); 
+0

他の詳細(実行計画とインデックス情報)がない場合は、パラメータスニッフィングの修正を試してください。あなたは '@ Student_Id_loc'を宣言してそれを' @Support_Id'で代入し、あなたのクエリで '@Support_Id_loc'を使用できますか? 'オプション(再コンパイル)' –

+1

を削除して、レポートサーバの 'executionlog3'テーブルを調べ、どこに時間がかかるかを確認することもできます。あなたは 'TimeDataRetrieval'、' TimeProcessing'と 'TimeRendering'カラムを持っています。 –

+0

これらのタイミングは、アプリケーションのReportViewerからレポートを実行するタイミングです。はいの場合は、正常に実行されたレポートのように見えます。あなたのアプリケーション内のいくつかの他の問題かもしれません。 –

答えて

-1

でレポートを取得するために使用私のC#のコードですが、私は同じ問題を抱えていました。あなたのSPに新しい変数を宣言し、最初に "@Student_Id"という値を入れてから、この新しい変数をクエリに使用してください。

あなたのためにもうまくいきたいです

+0

私はすでにそれが動作していない試みた – Alex

関連する問題