private ModelReportInfo getStudentBankChallanStudentInfo(int reportID) { ModelReportInfo lstModelReportInfo = new ModelReportInfo(); lstModelReportInfo = DALCommonFormData.GetReportInfoModel(reportID); return(lstModelReportInfo); }
//Get Repor Info Data Table public static ModelReportInfo GetReportInfoModel(int ReportId) { ModelReportInfo objModelReportInfo = new ModelReportInfo(); try { DataTable tblReportsList = new DataTable(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@ReportId", ReportId); tblReportsList = DALCommon.GetDataUsingDataTable("[sp_Admin_GetReportInfoByReportId]", param); if (tblReportsList.Rows.Count > 0) { objModelReportInfo.ReportFilePathName = Convert.ToString(tblReportsList.Rows[0]["ReportFilePathName"]); objModelReportInfo.SchoolAddressForReport = Convert.ToString(tblReportsList.Rows[0]["SchoolAddressForReport"]); objModelReportInfo.SchoolTitleForReport = Convert.ToString(tblReportsList.Rows[0]["SchoolTitleForReport"]); } } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "GetReportListDropdown, DALCommonFormData"); } return(objModelReportInfo); }
protected void Page_PreInit(object sender, EventArgs e) { try { crystalReportDocument = new ReportDocument(); string strRptPath = Server.MapPath("~/") + "Reports//" + DALCommonFormData.GetReportFileNamePath(ReportTypeID); crystalReportDocument.Load(strRptPath); ModelReportInfo lstModelReportInfo = new ModelReportInfo(); lstModelReportInfo = getStudentBankChallanStudentInfo(ReportTypeID); ParameterFields paramFields = new ParameterFields(); ParameterField paramField; ParameterDiscreteValue paramDiscreteValue; if (!String.IsNullOrEmpty(lstModelReportInfo.SchoolTitleForReport)) { paramField = new ParameterField(); paramField.Name = "SchoolNameTitle"; paramDiscreteValue = new ParameterDiscreteValue(); paramDiscreteValue.Value = lstModelReportInfo.SchoolTitleForReport; paramField.CurrentValues.Add(paramDiscreteValue); //Add the paramField to paramFields paramFields.Add(paramField); } if (!String.IsNullOrEmpty(lstModelReportInfo.SchoolAddressForReport)) { paramField = new ParameterField(); paramField.Name = "SchoolAddress"; paramDiscreteValue = new ParameterDiscreteValue(); paramDiscreteValue.Value = lstModelReportInfo.SchoolAddressForReport; paramField.CurrentValues.Add(paramDiscreteValue); //Add the paramField to paramFields paramFields.Add(paramField); } paramField = new ParameterField(); paramField.Name = "ReportTitle"; paramDiscreteValue = new ParameterDiscreteValue(); paramDiscreteValue.Value = ReportTitle; paramField.CurrentValues.Add(paramDiscreteValue); //Add the paramField to paramFields paramFields.Add(paramField); if (!IsPostBack) { rptStudentList.ParameterFieldInfo = paramFields; crystalReportDocument.SetDataSource(getStudentInfoBySearch()); //crystalReport.SetDataSource(dsStudentClass); rptStudentList.Dispose(); rptStudentList.ReportSource = crystalReportDocument; } else { rptStudentList.ParameterFieldInfo = paramFields; crystalReportDocument.SetDataSource(getStudentInfoBySearch()); //getStudentBankChallanFeeList() rptStudentList.Dispose(); rptStudentList.ReportSource = crystalReportDocument; } } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "StudentBankChallanReport.aspx.cs, Page_PreInit"); } }