コード例 #1
0
        private ModelReportInfo getStudentBankChallanStudentInfo(int reportID)
        {
            ModelReportInfo lstModelReportInfo = new ModelReportInfo();

            lstModelReportInfo = DALCommonFormData.GetReportInfoModel(reportID);
            return(lstModelReportInfo);
        }
コード例 #2
0
        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");
            }
        }