public void RenderReport(int loanId) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) return; User userData = (User)Session["AuthenticatedUser"]; //set reportviewr properties rptViewerLoanTerms.ProcessingMode = ProcessingMode.Local; rptViewerLoanTerms.Reset(); rptViewerLoanTerms.LocalReport.EnableExternalImages = true; rptViewerLoanTerms.LocalReport.ReportPath = Server.MapPath("~/Reports/RptLoanTerms.rdlc"); rptViewerLoanTerms.ZoomMode = ZoomMode.PageWidth; ReportAccess ra = new ReportAccess(); //Get loan details and set to reportviwer List<RptLoanTerms> loanTermsDetails = ra.RptLoanTermsDetails(loanId); rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", loanTermsDetails)); List<LoanDetailsRpt> details = ra.GetLoanDetailsRptforCompanySummary(userData.Company_Id, userData.UserId); rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet6", details)); //get curtailment schedule details and set to reportviwer CurtailmentAccess ca = new CurtailmentAccess(); List<Curtailment> curtailments = ca.retreiveCurtailmentByLoanId(loanId); if (curtailments != null && curtailments.Count > 0) { for (int i = 0; i < curtailments.Count; i++) { curtailments[i].CurtailmentId = i + 1; } } rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", curtailments)); //get fees details and set to reportviwer List<RptFeeLoanTerm> loanTermsFeeDetails = ra.RptLoanTermsFeeDetails(loanId); rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet3", loanTermsFeeDetails)); //get reminders details and set to reportviwer List<RptEmailReminder> loanTermsEmailReminders = ra.RptLoanTermsEmailReminders(loanId); rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet4", loanTermsEmailReminders)); //get unit types and set to reportviwer IList<UnitType> unitTypes = ra.RptGetUnitTypes(loanId); rptViewerLoanTerms.LocalReport.DataSources.Add(new ReportDataSource("DataSet5", unitTypes)); }