public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CollectorPaymentDetailsRPT rpt = new CollectorPaymentDetailsRPT(); rpt.Site = this.Site; return(rpt); }
private void btnCollectorPayment_Click(object sender, EventArgs e) { DataTable dataSetReport = new DataTable(); dataSetReport.TableName = "SupplierIncentiveDetails"; BoughtLeafBusinessLayer.MothlyPaymentSummary myMonthlySummary = new BoughtLeafBusinessLayer.MothlyPaymentSummary(); string supRoute = "%"; if (!chkRoute.Checked) { supRoute = cmbRoute.SelectedValue.ToString(); } string supCode = string.Empty; if (chkSupplier.Checked == true) { supCode = "%"; } else { supCode = cmbSupplier.SelectedValue.ToString(); } dataSetReport = myMonthlySummary.ListCollectorPayment(Convert.ToInt32(cmbYear.Text), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), "%").Tables[0]; dataSetReport.TableName = "CollectorPayment"; dataSetReport.WriteXml("CollecotrPaymentDetails.xml"); CollectorPaymentDetailsRPT myReport = new CollectorPaymentDetailsRPT(); 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(); }