public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { cr_kampala_report rpt = new cr_kampala_report(); rpt.Site = this.Site; return(rpt); }
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; } }