コード例 #1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if ((int)cmbPayrollPeriod.SelectedValue == 0 || cmbPayrollPeriod.SelectedValue == null)
            {
                Validation.FocusComboBox(cmbPayrollPeriod, "Payroll Period");
                return;
            }
            else if (cmbEmpType.Text == "")
            {
                Validation.FocusComboBox(cmbEmpType, "Employee Type");
                return;
            }
            else
            {
                frmRptViewer frm        = new frmRptViewer();
                string       exeFolder  = Path.GetDirectoryName(Application.StartupPath);
                string       reportPath = Path.Combine(exeFolder, "..\\Reports\\RptPayrollList.rdlc");
                frm.reportViewer1.LocalReport.ReportPath = reportPath;
                ReportParameter generatedBy = new ReportParameter("UserFullName", GlobalSession.UserFullName);

                var list = _payrollService.GetPayrollList((int)cmbPayrollPeriod.SelectedValue, cmbEmpType.Text);
                frm.reportViewer1.LocalReport.DataSources.Clear();
                ReportDataSource rs = new ReportDataSource {
                    Name = "ds_payroll", Value = list
                };

                frm.reportViewer1.LocalReport.DataSources.Add(rs);
                frm.reportViewer1.PrinterSettings.DefaultPageSettings.Landscape = true;
                frm.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { generatedBy });

                frm.ShowDialog();
            }
        }
コード例 #2
0
ファイル: frmEmployees.cs プロジェクト: radtek/TimeKeeping
        private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (listView1.SelectedItems.Count < 1)
            {
                MessageBox.Show("Pls. Select an Item.", "Select Item", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                EmployeeForInsertModel emp = svc.Employee_SelectById(int.Parse(listView1.SelectedItems[0].Text));
                frmRptViewer           frm = new frmRptViewer();
                string exeFolder           = Path.GetDirectoryName(Application.StartupPath);
                string reportPath          = Path.Combine(exeFolder, "..\\Reports\\RptEmpProfile.rdlc");
                frm.reportViewer1.LocalReport.ReportPath = reportPath;
                ReportParameter generatedBy = new ReportParameter("UserFullName", GlobalSession.UserFullName);
                ReportParameter imagePath   = new ReportParameter("ImagePath", AppDomain.CurrentDomain.BaseDirectory + "EmpPics\\ProfilePic\\" + listView1.SelectedItems[0].Text + "\\" + emp.EmployeeBasicInfo.PicName);
                List <EmployeeBasicInfoForInsertModel>   empBasicinfo   = new List <EmployeeBasicInfoForInsertModel>();
                List <EmployeeContactInfoForInsertModel> empContactInfo = new List <EmployeeContactInfoForInsertModel>();
                List <EmployeeEducationForInsertModel>   empEducation   = new List <EmployeeEducationForInsertModel>();
                List <EmployeeEmpInfoForInsertModel>     empEmployment  = new List <EmployeeEmpInfoForInsertModel>();
                empBasicinfo.Add(emp.EmployeeBasicInfo);
                empContactInfo.Add(emp.EmployeeContactInfo);
                empEducation.Add(emp.EmployeeEducation);
                empEmployment.Add(emp.EmployeeEmpInfo);
                frm.reportViewer1.LocalReport.DataSources.Clear();
                ReportDataSource rs = new ReportDataSource {
                    Name = "ds_employee_basicinfo", Value = empBasicinfo
                };
                ReportDataSource rs1 = new ReportDataSource {
                    Name = "ds_employee_contactinfo", Value = empContactInfo
                };
                ReportDataSource rs2 = new ReportDataSource {
                    Name = "ds_employee_education", Value = empContactInfo
                };
                ReportDataSource rs3 = new ReportDataSource {
                    Name = "ds_employee_employment", Value = empEmployment
                };

                frm.reportViewer1.LocalReport.DataSources.Add(rs);
                frm.reportViewer1.LocalReport.DataSources.Add(rs1);
                frm.reportViewer1.LocalReport.DataSources.Add(rs2);
                frm.reportViewer1.LocalReport.DataSources.Add(rs3);
                frm.reportViewer1.LocalReport.EnableExternalImages = true;
                frm.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { generatedBy, imagePath });
                frm.ShowDialog();
            }
        }
コード例 #3
0
        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmRptViewer frm        = new frmRptViewer();
            string       exeFolder  = Path.GetDirectoryName(Application.StartupPath);
            string       reportPath = Path.Combine(exeFolder, "..\\Reports\\RptEmpWorkloadBySemId.rdlc");

            frm.reportViewer1.LocalReport.ReportPath = reportPath;
            ReportParameter generatedBy = new ReportParameter("UserFullName", GlobalSession.UserFullName);

            frm.reportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource rs = new ReportDataSource {
                Name = "ds_Workload", Value = wsvc.Workload_BySemId((int)cmbSemester.SelectedValue)
            };

            frm.reportViewer1.LocalReport.DataSources.Add(rs);
            frm.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { generatedBy });
            frm.ShowDialog();
        }
コード例 #4
0
ファイル: frmEmployees.cs プロジェクト: radtek/TimeKeeping
        private void button1_Click(object sender, EventArgs e)
        {
            frmRptViewer frm        = new frmRptViewer();
            string       exeFolder  = Path.GetDirectoryName(Application.StartupPath);
            string       reportPath = Path.Combine(exeFolder, "..\\Reports\\RptEmpMasterlist.rdlc");

            frm.reportViewer1.LocalReport.ReportPath = reportPath;
            ReportParameter generatedBy = new ReportParameter("UserFullName", GlobalSession.UserFullName);

            frm.reportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource rs = new ReportDataSource {
                Name = "ds_EmpMasterlist", Value = list
            };

            frm.reportViewer1.LocalReport.DataSources.Add(rs);
            frm.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { generatedBy });
            frm.ShowDialog();
        }
コード例 #5
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmRptViewer frm        = new frmRptViewer();
            string       exeFolder  = Path.GetDirectoryName(Application.StartupPath);
            string       reportPath = Path.Combine(exeFolder, "..\\Reports\\RptDTR_Individual.rdlc");

            frm.reportViewer1.LocalReport.ReportPath = reportPath;
            ReportParameter generatedBy = new ReportParameter("UserFullName", GlobalSession.UserFullName);

            frm.reportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource rs = new ReportDataSource {
                Name = "ds_DTR_IndividualLog", Value = list
            };

            frm.reportViewer1.LocalReport.DataSources.Add(rs);
            frm.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { generatedBy });
            frm.ShowDialog();
        }
コード例 #6
0
ファイル: frmSlackMatCount.cs プロジェクト: windygu/SGWMS
 private void btnPrintSum_Click(object sender, EventArgs e)
 {
     if ((this.tbMain == null) || (this.bdsMain.Count == 0))
     {
         MessageBox.Show("无数据记录记录!");
     }
     else
     {
         frmRptViewer viewer = new frmRptViewer {
             RptTitle = "呆滞物料汇总报表"
         };
         rptSlackMatCount count = new rptSlackMatCount();
         count.SetDataSource(this.tbMain);
         viewer.RptObj = count;
         viewer.SetReport();
         viewer.ShowDialog();
         viewer.Dispose();
         count.Dispose();
     }
 }