Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            SupplierPaymentSummaryRouteRPT rpt = new SupplierPaymentSummaryRouteRPT();

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

            dataSetReport.TableName = "SupplierPaymentsSummaryTown";

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

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

            dataSetReport.WriteXml("SupplierPaymentsSummaryTown.xml");
            SupplierPaymentSummaryRouteRPT myReport = new SupplierPaymentSummaryRouteRPT();

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

            myReport.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName());
            myReport.SetParameterValue("PayRate", mySettings.getKiloRate(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())).ToString("N2"));
            myReport.SetParameterValue("CheckTotal", myBank.getCheckPaymentTotal(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())));
            myReport.SetParameterValue("BankTotal", myMonthlySummary.getBankPaymentSummaryTotal(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())));
            myReport.SetParameterValue("CashTotal", myMonthlySummary.getCashPaymentSummaryTotal(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())));
            myReport.SetParameterValue("Year", cmbYear.Text);
            myReport.SetParameterValue("SupCount", myMonthlySummary.getMonthlyActiveSupplier(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString())));
            myReport.SetParameterValue("Month", cmbMonth.SelectedValue.ToString());
            rptViewer.crystalReportViewer1.ReportSource = myReport;

            rptViewer.Show();
        }