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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void crystalReportViewer1_ReportRefresh(object source, CrystalDecisions.Windows.Forms.ViewerEventArgs e)
        {
            DTO.fThongKeMonAnDTO  fthongkemonan = new DTO.fThongKeMonAnDTO();
            DataTable             table         = fthongkemonan.LayDS_MA();
            CrystalReport_tkMonAn report        = new CrystalReport_tkMonAn();

            report.SetDataSource(table);
            crystalReportViewer1.ReportSource = report;
        }
        private void frmThongKeMonAn_Shown(object sender, EventArgs e)
        {
            DTO.fThongKeMonAnDTO  fthongkemonan = new DTO.fThongKeMonAnDTO();
            DataTable             table         = fthongkemonan.LayDS_MA();
            CrystalReport_tkMonAn report        = new CrystalReport_tkMonAn();

            report.SetDataSource(table);
            crystalReportViewer1.ReportSource = report;
        }
        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
            CrystalReport_tkMonAn report = new CrystalReport_tkMonAn();

            CrystalDecisions.Shared.TableLogOnInfo tlicurrent = new CrystalDecisions.Shared.TableLogOnInfo();
            foreach (CrystalDecisions.CrystalReports.Engine.Table tbcurrent in report.Database.Tables)
            {
                tlicurrent = tbcurrent.LogOnInfo;
                tlicurrent.ConnectionInfo.ServerName = Environment.MachineName;
                tbcurrent.ApplyLogOnInfo(tlicurrent);
            }
        }