public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { SupplierPaymentSummaryRPT rpt = new SupplierPaymentSummaryRPT(); rpt.Site = this.Site; return(rpt); }
private void btnPaySmry_Click(object sender, EventArgs e) { DataTable dataSetReport = new DataTable(); dataSetReport.TableName = "SupplierPaymentsSummary"; BoughtLeafBusinessLayer.MothlyPaymentSummary myMonthlySummary = new BoughtLeafBusinessLayer.MothlyPaymentSummary(); string supCode = string.Empty; if (chkSupplier.Checked == true) { supCode = "%"; } else { supCode = cmbSupplier.SelectedValue.ToString(); } string strRoute = "%"; if (chkRoute.Checked) { strRoute = "%"; } else { strRoute = cmbRoute.SelectedValue.ToString(); } dataSetReport = myMonthlySummary.getSupplierPaymentsDetail(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), supCode, strRoute).Tables[0]; dataSetReport.WriteXml("SupplierPaymentsSummary.xml"); SupplierPaymentSummaryRPT myReport = new SupplierPaymentSummaryRPT(); myReport.SetDataSource(dataSetReport); ReportViewer rptViewer = new ReportViewer(); myReport.SetParameterValue("Company", BoughtLeafBusinessLayer.BLUser.getCompanyName()); myReport.SetParameterValue("Year", cmbYear.Text); myReport.SetParameterValue("Month", cmbMonth.SelectedValue.ToString()); myReport.SetParameterValue("payRate", mySettings.getKiloRate(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue))); 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()))); rptViewer.crystalReportViewer1.ReportSource = myReport; rptViewer.Show(); }