コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            cr_kampala_report rpt = new cr_kampala_report();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void frm_kampala_active_guards_report_Load(object sender, EventArgs e)
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            cr_kampala_report report = new cr_kampala_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.SELECT_ACTIVE_GUARDS_KAMPALA("", SystemConst._branch));
            //check if user selected kampala
            if (SystemConst._branch == "KAMPALA")
            {
                report.SetParameterValue("QueryName", "SELECT_ACTIVE_GUARDS_KAMPALA_COMBINED");
                report.SetParameterValue("branch", SystemConst._branch);
                report.SetParameterValue("update_month", SystemConst._Report_update_month);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                cr_active_kampala_guards_report.ParameterFieldInfo = paramFields;


                this.cr_active_kampala_guards_report.ReportSource = report;
            }
            else
            {
                report.SetParameterValue("QueryName", "SELECT_ACTIVE_GUARDS_KAMPALA");
                report.SetParameterValue("branch", SystemConst._branch);
                report.SetParameterValue("update_month", SystemConst._Report_update_month);
                report.SetParameterValue("client_name", SystemConst.ClientName);
                cr_active_kampala_guards_report.ParameterFieldInfo = paramFields;


                this.cr_active_kampala_guards_report.ReportSource = report;
            }
        }