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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            ds = objListing.getEPFEmployeeDetails(cmbDivision.SelectedValue.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                ds.WriteXml("EmployeeEPFDetails.xml");
                EmployeeEPFDetailsRPT myReport = new EmployeeEPFDetailsRPT();
                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..!");
            }
        }