public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            RptDoanhThuTheoThang rpt = new RptDoanhThuTheoThang();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemplo n.º 2
0
        public void LoadDoanhThuTheoNam()
        {
            try
            {
                RptDoanhThuTheoThang _doanhthuthang = new RptDoanhThuTheoThang();
                //ParameterValues a = new ParameterValues();
                //ParameterDiscreteValue b = new ParameterDiscreteValue();
                //b.Value = _nam;
                //a.Add(b);
                //_doanhthuthang.DataDefinition.ParameterFields["@Nam"].ApplyCurrentValues(a);

                string path = Application.StartupPath + "\\RptDoanhThuTheoThang.rpt";
                _doanhthuthang.FileName = path;

                _doanhthuthang.SetDatabaseLogon("sa", "dmc3star", "TIENTHANH-PC", "phong_kham_benh");
                _doanhthuthang.SetParameterValue("@Nam", _nam);
                crystalReportViewer1.ReportSource = _doanhthuthang;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }