Ejemplo n.º 1
0
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();

            ds = myreport.getBlockPluckingRegister((cmbDivision.SelectedValue.ToString()), (dtDate.Value.Date));
            ds.WriteXml("BlockPluckingRegister.xml");

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

                myDailyRep.SetParameterValue("Company Name", FTSPayRollBL.Company.getCompanyName());
                myDailyRep.SetParameterValue("Date", "Date : " + dtDate.Value.Date);
                myDailyRep.SetParameterValue("Division", "Division : " + cmbDivision.SelectedValue.ToString());
                myDailyRep.SetParameterValue("WorkType", "Block Plucking");
                myReportViewer.crystalReportViewer1.ReportSource = myDailyRep;
                myReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data to Preview..!");
            }
        }
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BlockPluckingRegisterRPT rpt = new BlockPluckingRegisterRPT();

            rpt.Site = this.Site;
            return(rpt);
        }