Hi I’m getting different errors when I’m trying to load mg report on my website page.. I’m using a report viewer and I’m passing parameters using linq.. attached is the code and the errors.
An error has occurred during report processing.
Internal connection fatal error.
An error has occurred during report processing.
Cannot read the next data row for the data set SummaryReport.
Internal connection fatal error.
ReportGenerationBL report_worker = new ReportGenerationBL();
IEnumerable<ART.Library.Data.SummaryReport> items=report_worker.getSummaryReport();
rpt_view.Reset();
ReportDataSource[] reportds = new ReportDataSource[2];
reportds[0] = new ReportDataSource("RenewableObj", report_worker.getRenewablePackage());
reportds[1] = new ReportDataSource("SummaryReport", items.Where(a=>a.Title!="No Status"));
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("p_OldPlanAwaiting", items.Where(a => a.Title == "No Status" && a.Category == 0).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_OldPlanRenewable", items.Where(a => a.Title != "No Status" && a.Category == 0).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_OldPlanRenewed", items.Where(a => a.Title != "No Status" && a.Category == 0 && a.Renewed == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_OldPlanRenewedMSF2", items.Where(a => a.Title != "No Status" && a.Category == 0 && a.Renewed == 1).Sum(a => a.MSFOldPlans).ToString()));
paramList.Add(new ReportParameter("p_VoiceAwaiting", items.Where(a => a.Title == "No Status" && a.Category == 3).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_VoiceRenewable", items.Where(a => a.Title != "No Status" && a.Category == 3).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_VoiceRenewed", items.Where(a => a.Title != "No Status" && a.Category == 3 && a.Renewed == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_VoiceRenewedMSF", items.Where(a => a.Title != "No Status" && a.Category == 3 && a.Renewed == 1).Sum(a => a.MSFVoiceOnly).ToString()));
paramList.Add(new ReportParameter("p_NoVoiceAwaiting", items.Where(a => a.Title == "No Status" && a.Category == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_NoVoiceRenewable", items.Where(a => a.Title != "No Status" && a.Category == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_NoVoiceRenewed", items.Where(a => a.Title != "No Status" && a.Category == 1 && a.Renewed == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_NoVoiceRenewedMSF", items.Where(a => a.Title != "No Status" && a.Category == 1 && a.Renewed == 1).Sum(a => a.MSFNoVoice).ToString()));
paramList.Add(new ReportParameter("p_WithOthersAwaiting", items.Where(a => a.Title == "No Status" && a.Category == 2).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_WithOthersRenewable", items.Where(a => a.Title != "No Status" && a.Category == 2).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_WithOthersRenewed", items.Where(a => a.Title != "No Status" && a.Category == 2 && a.Renewed == 1).Sum(a => a.Counter).ToString()));
paramList.Add(new ReportParameter("p_WithOthersRenewedMSF", items.Where(a => a.Title != "No Status" && a.Category == 2 && a.Renewed == 1).Sum(a => a.MSFWithVoice).ToString()));
rpt_view.LocalReport.DataSources.Add(reportds[0]);
rpt_view.LocalReport.DataSources.Add(reportds[1]);
rpt_view.LocalReport.ReportPath = "PrintFile/SummaryReport.rdlc";
rpt_view.LocalReport.SetParameters(paramList);
rpt_view.DataBind();
pls help me..
code for getsummary calls for the sql function in the db.
public IEnumerable<SummaryReport> getSummaryReport()
{
IEnumerable<SummaryReport> items = from a in ARTDB.func_SummaryReport()
select new SummaryReport { Counter = TryParse.TryParseInt(a.counter), Status = a.status, Title = a.title, SortNo = TryParse.TryParseInt(a.sortno), Category = TryParse.TryParseInt(a.category), Renewed = a.renewed ,MSFNoVoice = a.msfnovoice,MSFOldPlans = a.msfoldplans, MSFVoiceOnly = a.msfvoiceonly, MSFWithVoice = a.msfwithvoice};
return items;
}
it calls the function stored in the database already.. here is the code in the designer.
public IQueryable<func_SummaryReportResult> func_SummaryReport()
{
return this.CreateMethodCallQuery<func_SummaryReportResult>(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
}
I haven’t used DataContext.CreateMethodCallQuery before, but I’m guessing it uses deferred execution. Try returning
items.ToList()ingetSummaryReport():