Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            guard_single_report rpt = new guard_single_report();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void frmcrystal_report_single_Load(object sender, EventArgs e)
        {
            if (SystemConst._Single_report_type == "Active")
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                guard_single_report report = new guard_single_report();

                ParameterFields        paramFields        = new ParameterFields();
                ParameterField         paramField         = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
                {
                    Set_Report_logons.SetTableLogin(tbCurrent);
                }

                report.SetDataSource(sg_Reports.RETURN_OFFICER_DETAILS("", SystemConst.guard_number));
                report.SetParameterValue("QueryName", "SELECT_GUARD_REPORT_SINGLE");
                report.SetParameterValue("guard_number", SystemConst.guard_number);
                report.SetParameterValue("guard_status", String.Empty);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                crystalReportViewer1.ParameterFieldInfo = paramFields;


                this.crystalReportViewer1.ReportSource = report;
                //this.crystalReportViewer1.RefreshReport();
            }
            else if (SystemConst._Single_report_type == "Archieve")
            {
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                guard_single_report report = new guard_single_report();

                ParameterFields        paramFields        = new ParameterFields();
                ParameterField         paramField         = new ParameterField();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

                foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables)
                {
                    Set_Report_logons.SetTableLogin(tbCurrent);
                }

                report.SetDataSource(sg_Reports.RETURN_OFFICER_DETAILS("", SystemConst.guard_number));
                report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_REPORT_SINGLE");
                report.SetParameterValue("guard_number", SystemConst.guard_number);
                report.SetParameterValue("guard_status", String.Empty);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                crystalReportViewer1.ParameterFieldInfo = paramFields;


                this.crystalReportViewer1.ReportSource = report;
                //this.crystalReportViewer1.RefreshReport();
            }
        }