I have a SSRS report.
When I open the report using SSRS browser page at http://localhost/reportserver the report works fine and loading data. Data is just 4 rows.
But when I embed the report in report Viewer, it takes forever to load means never loads just progress status showing.
I have added option(recompile)
but still no result.
Following is my 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 s.Id=@Student_Id
option(recompile)
END
Following is my C# code that I used to get report in reportViewer
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);
@Student_Id_loc
and assign it with@Student_Id
and use@Student_Id_loc
in your query. Removeoption(recompile)
– AB_87executionlog3
table in reporting server and check where does it take time. You haveTimeDataRetrieval
,TimeProcessing
andTimeRendering
columns which will tell you what needs fixing. – AB_87