public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { EmployeesAboveToInactiveRPT rpt = new EmployeesAboveToInactiveRPT(); rpt.Site = this.Site; return(rpt); }
private void btnAboveToChange_Click(object sender, EventArgs e) { if (chkAllDiv.Checked) { DataSet dsEmpGangsReport = new DataSet(); dsEmpGangsReport.Tables.Add(objempCurrentStatus.getListOfEmployeesAboveToChangeStatus(EstDivBlock.getEstateId(), "%", "Active", Convert.ToInt32(dtInactiveDuration.Rows[0][0].ToString()), true)); //dsEmpGangsReport = objempCurrentStatus.ListEmployeeStatusChangeLog("%", Convert.ToDateTime(DateTime.Now.Date.ToShortDateString())); if (dsEmpGangsReport.Tables[0].Rows.Count > 0) { dsEmpGangsReport.WriteXml("EmployeesAboveToChange.xml"); EmployeesAboveToInactiveRPT objReport = new EmployeesAboveToInactiveRPT(); objReport.SetDataSource(dsEmpGangsReport); ReportViewerForm objReportViewer = new ReportViewerForm(); objReport.SetParameterValue("Company", FTSPayRollBL.Company.getCompanyName()); objReport.SetParameterValue("Estate", EstDivBlock.ListEstates().Rows[0][0].ToString()); objReportViewer.crystalReportViewer1.ReportSource = objReport; objReportViewer.Show(); } else { MessageBox.Show("No Data To Preview"); } } else { DataSet dsEmpGangsReport = new DataSet(); dsEmpGangsReport.Tables.Add(objempCurrentStatus.getListOfEmployeesAboveToChangeStatus(EstDivBlock.getEstateId(), cmbDivision.SelectedValue.ToString(), "Active", Convert.ToInt32(dtInactiveDuration.Rows[0][0].ToString()), true)); //dsEmpGangsReport = objempCurrentStatus.ListEmployeeStatusChangeLog("%", Convert.ToDateTime(DateTime.Now.Date.ToShortDateString())); if (dsEmpGangsReport.Tables[0].Rows.Count > 0) { dsEmpGangsReport.WriteXml("EmployeesAboveToChange.xml"); EmployeesAboveToInactiveRPT objReport = new EmployeesAboveToInactiveRPT(); objReport.SetDataSource(dsEmpGangsReport); ReportViewerForm objReportViewer = new ReportViewerForm(); objReport.SetParameterValue("Company", FTSPayRollBL.Company.getCompanyName()); objReport.SetParameterValue("Estate", EstDivBlock.ListEstates().Rows[0][0].ToString()); objReportViewer.crystalReportViewer1.ReportSource = objReport; objReportViewer.Show(); } else { MessageBox.Show("No Data To Preview"); } } }