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

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void cmdDisplay_Click(object sender, EventArgs e)
        {
            String strDiv = "%";
            String strCat = "%";

            try
            {
                //changes
                if (chkAllDivisions.Checked)
                {
                    strDiv = "%";
                }
                else
                {
                    strDiv = cmbDivision.SelectedValue.ToString();
                }
                if (chkAllCategory.Checked)
                {
                    strCat = "%";
                }
                else
                {
                    strCat = cmbEmployeeCategory.SelectedValue.ToString();
                }
                //---------
                dataSetReport = myReports.getWorkDistributionDetail(strDiv, Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), strCat);
                dataSetReport.WriteXml("WorkDistributionDetail.xml");
                WorkDistributionDetailRPT myaclist = new WorkDistributionDetailRPT();
                myaclist.SetDataSource(dataSetReport);
                ReportViewer myReportViewer = new ReportViewer();

                myaclist.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                myaclist.SetParameterValue("Estate", "Estate : " + myDivision.ListEstate().Rows[0][1].ToString());
                myaclist.SetParameterValue("Options", "For Division : " + cmbDivision.Text + " and Category : " + cmbEmployeeCategory.Text + " for the Month of : " + cmbMonth.Text + "/" + cmbYear.Text);
                myReportViewer.crystalReportViewer1.ReportSource = myaclist;
                myReportViewer.Show();
                //----------
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }