Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crIPOApproavedUniapproaved rpt = new crIPOApproavedUniapproaved();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void RB()
        {
            DataTable dt = new DataTable();

            dt = objBAL.IPOSuccessfulUnsuccessfulApplication(cmbStatusName.Text, Cmbcompanyname.Text, CmbCustomerCode.Text);
            crIPOSuccessfulUnsuccessful objRPT    = new crIPOSuccessfulUnsuccessful();
            crIPOApproavedUniapproaved  objRPTapp = new crIPOApproavedUniapproaved();

            frmIPOReportViewer viewer = new frmIPOReportViewer();

            if (cmbStatusName.Text == "Successfull" || cmbStatusName.Text == "Unsuccessfull")
            {
                objRPT.SetDataSource(dt);
                if (cmbStatusName.Text == "Successfull")
                {
                    ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                        "IPO Successfull Status";
                }
                else if (cmbStatusName.Text == "Unsuccessfull")
                {
                    ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                        "IPO Unsuccessfull Status";
                }

                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
            else if (cmbStatusName.Text == "All")
            {
                objRPT.SetDataSource(dt);
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "IPO All Kind of Status";
                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
            else if (cmbStatusName.Text == "Approved")
            {
                objRPT.SetDataSource(dt);
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "IPO Approved Status";
                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
            else if (cmbStatusName.Text == "Pending")
            {
                objRPT.SetDataSource(dt);
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "IPO Pending Status";
                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
            else if (cmbStatusName.Text == "Rejected")
            {
                objRPT.SetDataSource(dt);
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "IPO Rejected Status";
                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
            else if (cmbStatusName.Text == "Check")
            {
                objRPT.SetDataSource(dt);
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "IPO Rejected Status";
                GetCommonInfo();
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ///// Load Branch Name
                ((TextObject)objRPT.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                viewer.crystalReportViewer1.ReportSource = objRPT;
                viewer.Show();
            }
        }