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

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet ds        = new DataSet();
            String  AllDiv    = "%";
            String  AllCat    = "%";
            String  AllGender = "%";

            if (!chkAllDiv.Checked)
            {
                AllDiv = cmbDivision.SelectedValue.ToString();
            }
            if (!chkAllCat.Checked)
            {
                AllCat = cmbAllCat.SelectedValue.ToString();
            }
            if (!chkAllGender.Checked)
            {
                AllGender = cmbAllGender.SelectedValue.ToString();
            }
            ds = objListing.getEmployeeDetails(AllDiv, AllCat, AllGender);

            if (ds.Tables[0].Rows.Count > 0)
            {
                ds.WriteXml("EmployeeDetails.xml");
                EmployeeDetailsRep myReport = new EmployeeDetailsRep();
                myReport.SetDataSource(ds);

                ReportViewer myReportViewer = new ReportViewer();
                myReport.SetParameterValue("Company", FTSPayRollBL.Company.getCompanyName());
                myReport.SetParameterValue("Estate", "ESTATE :" + myUser.GetEstates().Tables[0].Rows[0][1].ToString());
                myReportViewer.crystalReportViewer1.ReportSource = myReport;
                myReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data to preview..!");
            }
        }