private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ReportViewerDemo.Reset();
            DataTable dt = GetData();

            ReportDataSource dsDataSource = new ReportDataSource("DataSet1", dt); //ReportDataSource("", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(dsDataSource);

            //embbedded to RDLC report file
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "QLTH.BangDiem.rdlc";
            //ReportViewerDemo.LocalReport.ReportPath = "\\RDLC_Report\\GiaoVien.rdlc";


            //Get information about School such as school's name and principal's name
            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandText = "SELECT HOTEN, MALOP, DTB_HOCKY, XEPLOAI FROM HOCSINH, TONGKET WHERE HOCSINH.MAHS = TONGKET.MAHS AND HOCSINH.NAMHOC = @NAMHOC AND HOCKY = @HOCKY AND TONGKET.MAHS = @MAHS";
                cmd.Parameters.AddWithValue("@NAMHOC", strNamHoc);
                cmd.Parameters.AddWithValue("@HOCKY", drvData.Row[3].ToString());
                cmd.Parameters.AddWithValue("@MAHS", drvData.Row[0].ToString());
                SqlDataReader dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    strHoTen   = dr.GetString(0);
                    strLop     = dr.GetString(1);
                    strDTB     = dr.GetDouble(2).ToString();
                    strXepLoai = dr.GetString(3);
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Có lỗi trong quá trình liên kết cơ sở dữ liệu");
            }

            conn.Close();



            //Parameters
            ReportParameter[] rptParameter = new ReportParameter[]
            {
                new ReportParameter("HoTenHS", strHoTen),
                new ReportParameter("Lop", strLop),
                new ReportParameter("NamHoc", strNamHoc),
                new ReportParameter("HocKy", drvData.Row[3].ToString()),
                new ReportParameter("DTB", strDTB),
                new ReportParameter("XepLoai", strXepLoai)
            };
            ReportViewerDemo.LocalReport.SetParameters(rptParameter);


            ReportViewerDemo.RefreshReport();
        }
Пример #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            ReportViewerDemo.Reset();
            DataTable        dt = GetData();
            ReportDataSource ds = new ReportDataSource("DataSet1", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "WpfReportDemo.Report1.rdlc";
            ReportViewerDemo.RefreshReport();
        }
Пример #3
0
        public PayrollPrintView(int payrollPK)
        {
            InitializeComponent();


            var getPayroll = db.Payrolls.FirstOrDefault(a => a.PayrollPK == 1);
            //var deductions = db.Deductionss.Where(a => a.PayrollPK == getPayroll.PayrollPK).ToList();


            var deductionsJoin = db.Deductionss.Join(db.Payrolls, id => id.PayrollPK, forId => forId.PayrollPK, (id, forId) => new { id = id, forId = forId })
                                 .Where(a => a.id.PayrollPK == payrollPK && a.forId.PayrollPK == payrollPK)
                                 .GroupBy(a => a.id.UserName)
                                 .Select(l => new
            {
                PayrollViewKey = l.Key,
                UserName       = l.FirstOrDefault().id.UserName,
                LateDeduction  = l.FirstOrDefault().id.LateDeduction,
                BasicSalary    = l.FirstOrDefault().id.BasicSalary,
                Pagibig        = l.FirstOrDefault().id.PagibigDeduction,
                Accumulated    = l.FirstOrDefault().id.AllAccumulatedTimeAddition,
                SSS            = l.FirstOrDefault().id.SSSDeduction,
                TIN            = l.FirstOrDefault().id.TinDeduction,
                TotalSalary    = l.FirstOrDefault().id.TotalSalary,
                PayrollStart   = l.FirstOrDefault().forId.StartPayroll,
                PayrollEnd     = l.FirstOrDefault().forId.EndPayroll
            }).ToList();

            var otherJoin = deductionsJoin.Join(db.Employees, id => id.UserName, forId => forId.UserName, (id, forId) => new { id = id, forId = forId }).Where(a => a.id.UserName == a.forId.UserName).GroupBy(a => a.id.UserName)
                            .Select(l => new
            {
                PayrollViewKey = l.Key,
                UserName       = l.FirstOrDefault().id.UserName,
                LateDeduction  = l.FirstOrDefault().id.LateDeduction,
                BasicSalary    = l.FirstOrDefault().id.BasicSalary,
                Pagibig        = l.FirstOrDefault().id.Pagibig,
                Accumulated    = l.FirstOrDefault().id.Accumulated,
                SSS            = l.FirstOrDefault().id.SSS,
                TIN            = l.FirstOrDefault().id.TIN,
                TotalSalary    = l.FirstOrDefault().id.TotalSalary,
                PayrollStart   = l.FirstOrDefault().id.PayrollStart,
                PayrollEnd     = l.FirstOrDefault().id.PayrollEnd,
                FirstName      = l.FirstOrDefault().forId.FirstName,
                LastName       = l.FirstOrDefault().forId.LastName
            }).ToList();

            ReportViewerDemo.Reset();
            DataTable        dt = ToDataTable(otherJoin);
            ReportDataSource ds = new ReportDataSource("dataset", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.PayrollReport.rdlc";
            ReportViewerDemo.RefreshReport();
        }
Пример #4
0
        public Report(int id)
        {
            InitializeComponent();
            this.id = id;
            ReportViewerDemo.Reset();
            DataTable dt = GetData();

            Microsoft.Reporting.WinForms.ReportDataSource ds = new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dt);
            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "DoctorCashWpf.Printer.Report1.rdlc";
            ReportViewerDemo.RefreshReport();
        }
        public ReportsView()
        {
            InitializeComponent();

            ReportViewerDemo.Reset();
            ReportDataSource reportDataSource = new ReportDataSource("DataSet1", RegistroNacional.Instance.ListaCiudades);

            ReportViewerDemo.LocalReport.DataSources.Add(reportDataSource);

            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "MVVM_Template_Prism_WPF.Report1.rdlc";

            ReportViewerDemo.RefreshReport();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ReportViewerDemo.Reset();
            DataTable dt = GetData();

            ReportDataSource dsDataSource = new ReportDataSource("DataSet1", dt); //ReportDataSource("", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(dsDataSource);

            //embbedded to RDLC report file
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "QLTH.HocSinh.rdlc";
            //ReportViewerDemo.LocalReport.ReportPath = "\\RDLC_Report\\GiaoVien.rdlc";


            //Get information about School such as school's name and principal's name
            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandText = "Select * from THONGTINTRG";
                SqlDataReader dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    strName       = dr.GetString(1);
                    strHieuTruong = dr.GetString(3);
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Có lỗi trong quá trình liên kết cơ sở dữ liệu");
            }

            conn.Close();



            //Parameters
            ReportParameter[] rptParameter = new ReportParameter[]
            {
                new ReportParameter("TenTruong", strName.ToUpper()),
                new ReportParameter("TenHT", strHieuTruong),
                new ReportParameter("NamHoc", strNamHoc),
                new ReportParameter("Khoi", iKhoi.ToString())
            };
            ReportViewerDemo.LocalReport.SetParameters(rptParameter);


            ReportViewerDemo.RefreshReport();
        }
        public MainEmployeeMasterlistView(dynamic reportObject, dynamic date)
        {
            InitializeComponent();

            ReportViewerDemo.Reset();
            DataTable dt = ToDataTable(reportObject);

            ReportDataSource ds = new ReportDataSource("employeemasterlist", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);

            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.EmployeeMasterlist.rdlc";
            ReportViewerDemo.RefreshReport();
        }
        public MainTopPerformingView(dynamic reportObject, dynamic date)
        {
            InitializeComponent();

            ReportViewerDemo.Reset();
            DataTable        dt    = ToDataTable(reportObject);
            DataTable        dates = ToDataTable(date);
            ReportDataSource ds    = new ReportDataSource("topperforming", dt);
            ReportDataSource date1 = new ReportDataSource("dateTime", dates);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.DataSources.Add(date1);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.TopPerformingReport.rdlc";
            ReportViewerDemo.RefreshReport();
        }
        public MainAssesmentReportsView(dynamic reportObject, dynamic date)
        {
            InitializeComponent();

            ReportViewerDemo.Reset();
            DataTable        dt    = ToDataTable(reportObject);
            DataTable        dates = ToDataTable(date);
            ReportDataSource ds    = new ReportDataSource("assesmentreport", dt);
            ReportDataSource date2 = new ReportDataSource("dateTime", dates);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.DataSources.Add(date2);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.AssesmentReport.rdlc";
            ReportViewerDemo.RefreshReport();
        }
Пример #10
0
        public MainReportsView(dynamic reportObject, dynamic reportDate)
        {
            InitializeComponent();

            ReportViewerDemo.Reset();
            DataTable        dt      = ToDataTable(reportObject);
            DataTable        reportD = ToDataTable(reportDate);
            ReportDataSource ds      = new ReportDataSource("mainattendancereport", dt);
            ReportDataSource date    = new ReportDataSource("dateTime", reportD);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.DataSources.Add(date);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.AttendanceReport.rdlc";

            ReportViewerDemo.RefreshReport();
        }
Пример #11
0
        private void Load()
        {
            ReportViewerDemo.Reset();
            DataTable dt = GetData();

            ReportDataSource dsDataSource = new ReportDataSource("DataSet1", dt); //ReportDataSource("", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(dsDataSource);

            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "QuanLyHocSinh_OOAD.TongKet.rdlc";

            try
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandText = "Select * from THONGTINTRG";
                SqlDataReader dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    strName       = dr.GetString(1);
                    strHieuTruong = dr.GetString(3);
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Có lỗi trong quá trình liên kết cơ sở dữ liệu");
            }

            conn.Close();



            //Parameters
            ReportParameter[] rptParameter = new ReportParameter[]
            {
                new ReportParameter("TenTruong", strName.ToUpper()),
                new ReportParameter("TenHT", strHieuTruong),
                new ReportParameter("Lop", lop),
                new ReportParameter("NienKhoa", nienKhoa),
                new ReportParameter("HocKi", hocki.ToString())
            };
            ReportViewerDemo.LocalReport.SetParameters(rptParameter);
            ReportViewerDemo.RefreshReport();
        }
Пример #12
0
        public EvaluationPrintView(int evaluationPk)
        {
            InitializeComponent();


            var getEval = db.Evaluations.Where(a => a.EvaluationPK == evaluationPk).ToList();

            //var deductions = db.Deductionss.Where(a => a.PayrollPK == getPayroll.PayrollPK).ToList();

            ReportViewerDemo.Reset();
            DataTable        dt = ToDataTable(getEval);
            ReportDataSource ds = new ReportDataSource("evaluation", dt);

            ReportViewerDemo.LocalReport.DataSources.Add(ds);
            ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.EvaluationPrint.rdlc";
            ReportViewerDemo.RefreshReport();
        }
        public DailyAttendanceReport(List <DailyTimeRecord> dailyRecord)
        {
            InitializeComponent();

            try {
                ReportViewerDemo.Reset();
                DataTable dt = ToDataTable(dailyRecord);


                ReportDataSource ds = new ReportDataSource("attendance", dt);
                var user            = dailyRecord.FirstOrDefault().UserName;
                var getUser         = db.Employees.Where(a => a.UserName == user).ToList();

                ReportDataSource fullNameDataSource = new ReportDataSource("fullName", getUser);

                ReportViewerDemo.LocalReport.DataSources.Add(ds);
                ReportViewerDemo.LocalReport.DataSources.Add(fullNameDataSource);
                ReportViewerDemo.LocalReport.ReportEmbeddedResource = "EyeKnowRight.Reports.DailyReportPrint.rdlc";
                ReportViewerDemo.RefreshReport();
            }catch (Exception e)
            {
            }
        }