예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            ContractCWRegister rpt = new ContractCWRegister();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            DataSet ds      = new DataSet();
            String  EmpType = "All";

            if (chkAll.Checked)
            {
                cmbType.Enabled = false;
                EmpType         = "All";
            }
            else
            {
                cmbType.Enabled = true;
                EmpType         = cmbType.Text;
            }

            ds = myreport.getContractCWRegister((cmbDivision.SelectedValue.ToString()), (dtDate.Value.Date), 2, EmpType);
            ds.WriteXml("ContractCWRegister.xml");

            if (ds.Tables[0].Rows.Count > 0)
            {
                ContractCWRegister myDailyRep = new ContractCWRegister();
                myDailyRep.SetDataSource(ds);
                ReportViewer myReportViewer = new ReportViewer();

                myDailyRep.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                myDailyRep.SetParameterValue("Date", "Date : " + dtDate.Value.Date.ToShortDateString());
                myDailyRep.SetParameterValue("Division", "Division : " + cmbDivision.SelectedValue.ToString());
                myDailyRep.SetParameterValue("CashWork", "Contract Cash Work - " + cmbType.Text);
                myReportViewer.crystalReportViewer1.ReportSource = myDailyRep;
                myReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data to Preview..!");
            }
        }