private void btnDisplay_Click(object sender, EventArgs e)
        {
            String  strDivisionID    = cmbDivision.SelectedValue.ToString();
            String  strStatus        = cmbStatus.SelectedValue.ToString();
            DataSet dsEmployeeReport = new DataSet();

            if (chkAll.Checked)
            {
                dsEmployeeReport = objListing.getEmployeeDetails(strStatus.ToString());
                dsEmployeeReport.WriteXml("EmployeeDetails.xml");
            }
            else
            {
                dsEmployeeReport = objListing.getEmployeeDetails(strDivisionID.ToString(), strStatus.ToString());
                dsEmployeeReport.WriteXml("EmployeeDetails.xml");
            }
            if (dsEmployeeReport.Tables[0].Rows.Count > 0)
            {
                EmployeeReport objReport = new EmployeeReport();
                objReport.SetDataSource(dsEmployeeReport);
                ReportViewerForm objReportViewer = new ReportViewerForm();

                objReport.SetParameterValue("Estate", FTSPayRollBL.User.StrEstate);
                if (chkAll.Checked)
                {
                    objReport.SetParameterValue("Division", "");
                }
                else
                {
                    objReport.SetParameterValue("Division", "DivisionID : " + strDivisionID.ToString());
                }
                objReport.SetParameterValue("Status", "Employee Status : " + strStatus.ToString());
                objReportViewer.crystalReportViewer1.ReportSource = objReport;
                objReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data to Preview..!");
            }
        }
예제 #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     EmployeeReport rpt = new EmployeeReport();
     rpt.Site = this.Site;
     return rpt;
 }