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

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnLMDebt_Click(object sender, EventArgs e)
        {
            DataTable dataSetReport = new DataTable();

            dataSetReport.TableName = "PreviousMonthSummary";

            BoughtLeafBusinessLayer.MothlyPaymentSummary myMonthlySummary = new BoughtLeafBusinessLayer.MothlyPaymentSummary();

            dataSetReport = myMonthlySummary.getPreviousMonthDebts(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())).Tables[0];

            dataSetReport.WriteXml("PreviousMonthSummary.xml");
            PreviousMonthDebtSummaryRPT myReport = new PreviousMonthDebtSummaryRPT();

            myReport.SetDataSource(dataSetReport);
            ReportViewer rptViewer = new ReportViewer();

            myReport.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName());
            myReport.SetParameterValue("Year", cmbYear.Text);
            myReport.SetParameterValue("Month", cmbMonth.SelectedValue.ToString());

            rptViewer.crystalReportViewer1.ReportSource = myReport;
            rptViewer.Show();
        }